Skip to content

Commit

Permalink
Squashed 'externals/nitro/' changes from 496bfba71..342f55276
Browse files Browse the repository at this point in the history
342f55276 NITRO 2.10.13 (#542)
f0cc26bdd latest from coda-oss (#540)
b39ccc4c0 Fix conan build issues (#516)
103dd73ee latest from coda-oss (#508)
f71128d6f Adding tarfile member sanitization to extractall() (#505)
61dafd407 NITRO-2.10.12 (#496)
06993176d run unittests in SIX (#495)
f0d801e95 coda-oss release 2022-08-30 (#494)
8477e4729 Build jpeg decompression as a plugin. (#487)
59978233a latest from coda-oss (#493)
53bbc6679 latest from coda-oss (#492)
77a1114eb NITRO 2.10.11 (#491)
b5fb2d2a9 another round of removing compiler warnings (#489)
2342edbef coda-oss 2022-08-02 (#490)
7e1fe6a68 NITRO-2.10.10 (#486)
263a98cfc coda-oss 2022-06-29 (#485)
a3bb3a032 nitf::byte is too much trouble right now (#484)
8d28243d2 update CodeQL to @v2 (#483)
7091d36a6 Update coda-oss (#482)
f40179473 return std::optional<> from "enum" utilities (#480)
3972dba9e update coda-oss (#479)
3e38c39a0 latest from coda-oss (#477)
f27a3894e Do not add convenience test targets if given the libs_only flag.
ed0d1899b NITRO-2.10.9 (#476)
f4eacccaf coda-oss release 2022-05-03 (#475)
758ac88e1 latest from feature/j2k branch (#474)
b8a3f5076 tweaks to allow NITRO modules to be built as DLLs (#473)
af745281c latest from feature/j2k branch (#471)
a7da2fc74 build more C code as C++ (#469)
5dbd0d9cd latest from coda-oss (#468)
3e9387973 add lossy compression options (#464)
da6969ae0 latest from coda-oss (#465)
bd8ce8116 build most C with C++ (in Visual Studio ONLY) for better error-checking (#466)
dfeb3fe44 remove docs directory (#463)
2d52cf3f6 remove archive directory (#462)
5b11fe82c copy j2k code from coda (#460)
f02c70645 merge develop/update_coda-oss
8907b9fc3 latest from coda-oss (#461)
1124c00f9 switch VS unit-test projects to VS-test (#459)
c6e7a6e40 Merge branch 'master' of github.com:mdaus/nitro
ed828aaf6 fix CodeQL diagnostic
762b2a2ce NITRO version 2.10.8 (#456)
466534fd8 begin work in C++ wrappers for 'j2k' C API.
3b72561d2 update to coda-oss release 2022-02-22 (#455)
3f70bc3c3 latest from coda-oss (#454)
8a8ea90b0 build with older C++ compilers, compile C as C++ (#453)
9690f9076 update coda-oss (#451)
1d307d9aa latest from coda-oss (#449)
c71dc6d85 latest from coda-oss (#448)
db9f1d2a5 account for missing std::is_trivially_copyable<>  (#446)
7581fe17d latest from coda-oss (#445)
d991a0494 infrastructure to support "reflection" over C structs (#444)
edaf47f81 show how to use strongly-type TRE fields (#440)
8af36f6ed latest from coda-oss (#441)
fe89ce317 Re-add show_nitf++ app (#439)
9ea44741d nitro 2.10.7 (#436)
458055cfc coda-oss release 2021-12-13 (#435)
d4ad4b8a5 allow NITF_PLUGIN_PATH warning to be turned off (#434)
7c96994a9 allow NITF_PLUGIN_PATH warning to be turned off (#432)
1b22d00a6 latest from coda-oss (#431)
489f10d70 tweaks from develop/jdsmith (#426)
9461c626c latest from coda-oss (#425)
2e8d7cfae tweaks for new compiler on Windows (#424)
e868e3747 build with VS2022 (#423)
65b4df02d Build with Visual Studio 2022 (#422)
64dc4e118 -j 2 to prevent G++ crash
64ec3748c try -j 2 for faster build
c4e122edf include all of coda-oss (#421)
888ae9293 update version numbers before cutting a new release (#420)
28d95160e Tweaks from SIX's 8AMPI_PHSI branch (#418)
a0dd912a9 latest from coda-oss (#419)
dfba5e291 fix CodeQL failure (#417)
3c7653c3e make building as a DLL easier (#416)
e17d918d4 read in 8-bit sample files using NITRO (#415)
b78673982 use strongly-typed enums rather than overload strings (#414)
30fc68feb latest from coda-oss (#413)
a4a1fc4f8 add a NITF version number (#412)
eef3c6ec8 update coda-oss (#411)
f5f1f8ce1 "nitro" changes from SIX (#410)
1a19b6b60 latest from coda-oss (#409)
0db498f1e make the TRE API more robust (#406)
404a857ca Bugfix/engrda (#405)
1c73a5284 latest from coda-oss (#404)
9388d5cf2 latest from coda-oss (#402)
9578bcf83 Handle amp-phase data (#403)
81278527b remove compiler warnings that were clobbered by a previous merge (#401)
3ebffd877 update coda-oss (#400)
c8186387f tweak C++ API (#399)
dc000a516 latest from coda-oss (#398)
7af555d63 latest from coda-oss (#396)
cb37a8cff remove compiler warnings (#395)
1b6cfe099 latest from coda-oss (#388)
2229fbde0 forgot to add "units" to CMakeFiles.txt
e1a1bcefa latest from coda-oss (#387)
835da56f5 Bugfix/nitropy import error (#381)
508ee3e75 Fix invalid const cast error (#380)
7bb82996c update coda-oss (#378)
98e6bcf5d remove more code-analysis diagnostics (#377)
c3dc82205 update coda-oss (#376)
ffd5aa858 Revert "do a Debug build on Windows"
5d84be10c do a Debug build on Windows
e6cfbfab8 make parts of the C++ API a bit more python-like (#375)
75caf49ec remove compiler warnings/code-analysis diagnostics (#374)
a6cec9dfe update coda-oss (#373)
f4b80a31d reduce compiler warnings (#371)
4ddaf23d8 remove compiler warnings (#370)
2a57741c2 update coda-oss (#369)
d3fab714a update coda-oss (#368)
8806960a8 tweak to force rebuild of "master" on github
9aee934ea remove compiler warnings (#367)
7be6c13b1 set an "invalid" string result for invalid inputs (#366)
d4f244ee8 remove more compiler warnings/code-analysis diagnostics (#364)
d01179540 latest from coda-oss (#363)
a16f72b0c make it easier to build nitf-c++ as a shared library (#362)
35c5f4ade reduce compiler and code-analysis warnings (#361)
273c39e86 latest from coda-oss  (#360)
298536f40 remove unused coda-oss modules to fix? broken build (#351)
edb9317db Update README.md
152b1d66a Java and MATLAB bindings are no longer built.
2748224ba unittests work from clean build in VS2019 (#347)
296750e1d Delete codacy-analysis.yml
2121cda37 Delete checkmarx-analysis.yml
393b6cd55 Create codacy-analysis.yml
a01fa4d6f Create checkmarx-analysis.yml
effd34006 fix more CodeQL diagnostics (#346)
a2b3a12d9 Fixed bug in python interface, and enabled a few features in the c library to be accessible from python (#342)
1e171cdfc remove code-analysis diagnostics (#345)
c68cd17dd latest from coda-oss (#344)
bb0634924 update coda-oss (#343)
fa20f42ee use new coda-oss header for easier access to "std::" (#341)
c80e163ee Build w/older compilers; remove some code-analysis diagnostics (#340)
dfad79efc Delete ossar-analysis.yml
007ced759 archive matlab and java (#293)
0e201d8b0 Create ossar-analysis.yml
c4eae8e4c Create codeql-analysis.yml
ea1946b4a Delete codeql-analysis.yml
e40a0b3f6 add ENABLE_ASAN to turn on address sanitizer (#336)
2d9a968f2 fixed a bug where an uninitialized pointer caused a crash (#335)
7c5dbed7f `nullptr_t` should be `std::nullptr_t`
612a55889 remove version number from externals/coda-oss (#333)
c14639765 nitro doesn't need "re" module (#332)
14517c04f put a version on externals/coda-oss (#331)
8705bbb63 C iterator routines can be "const" (#330)
62ec49119 update coda-oss (#326)
b7f04aecb fix broken unit-test; implement missing overload (#325)
f810f8f6e Fix length calculation for moveTRE and unmergeTREs (#324)
ad0f83a6f Null init Image writers (#323)
e77ddad8f CMake: Build c libraries, in Windows, as DLLs (#321)
7a8dcf296 update coda-oss (#322)
f0a45b36d latest from coda-oss (#320)
d277cb432 revert c99 changes (#319)
1b6ae6adb hide template<template> from C++11 (#318)
ee89c7d34 Bug fixes, new TREs, and cython interface (#314)
f925204cb revert c99 changes (#317)
1615ce17b update coda-oss (#316)
0fbebcbdc update coda-oss (#313)
280141628 fix errors/warnings from code-diagnostic tools (#312)
f419dc538 Update .gitignore for CMakeSettings.json
2d73f0ee1 latest from coda-oss (#311)
0d6988eb1 latest from coda-oss (#310)
29a88056b get coda-oss #includes via coda-oss.hpp to augment "std" (#309)
5be4b7e63 "noexcept" is a breaking change ... be more careful with it. (#307)
92b19f9c5 remove nitf::byte (#306)
c1ef1e933 bring over non-breaking changes from "main" (#303)
1d91f312e latest from coda-oss (#300)
e6448b1dd tweaks so that six builds with nitro updates (#299)
d27779eb7 std::byte -> nitf::byte until we can use C++17 everywhere (#298)
413fadf3a Update .gitignore
5c6a2ef68 update coda-oss (#297)
8bb4d248c build with Visual Studio 2019 (#295)
698841c86 get unittest changes from main (#294)
9a29ce5f9 latest from coda-oss:master (#291)
67d325690 reduce compiler warnings and the like from C code (#292)
5c8c30b1c build new TREs w/CMake (#246)
4efc97eaf Add four TREs defined in MIL-PRF-89034. (#192)
e13921039 tre: add MATESA support (#244)
7e9b93f71 Create codeql-analysis.yml
eaafd58a1 java: update to supported version (#241)
59afdc92e Fix bug with myResidual calculation (#204)
050fcbc96 Fix assorted compiler warnings (#232)
cad5c02f9 update "documentation" (#231)
0fb160719 Revert "merge "main" into "master" (#224)"
0faaa0165 merge "main" into "master" (#224)
5579e74e8 update "master" with several changes from "develop" (#219)
ed0063048 coda-oss doesn't build "macos" so we don't either (#218)
033220f92 latest coda-oss from master-C++17 (#212)
7caacb941 copy some documentation from the old website; work-in-progress (#211)
0f0d05404 Feature/remove compiler warnings (#210)
9a609577c Feature/use standard c types (#209)
c83348fd3 ignore more build artifacts
3bb1ef02e Merge pull request #205 from mdaus/bugfix/Security-vulnerability-in-nitro
9757b5af5 fix a bunch of code-analysis warnings about using NULL pointers (mostly …
6b72b7c37 fix a bunch of code-analysis warnings about using NULL pointers (mostly benign as pointer won't actually be NULL)
22716b796 be sure local variables are initialized for all code paths
c0b7b38b9 no .vcxproj in this branch
40d66294a fix some build warnings
362b5492e build with VS2019 CMake support

git-subtree-dir: externals/nitro
git-subtree-split: 342f552768e249e86df702062ff3f60ea1ec813a
  • Loading branch information
Dan Smith authored and Dan Smith committed Mar 13, 2023
1 parent 84c56dc commit 2c7b84b
Show file tree
Hide file tree
Showing 2,207 changed files with 609,776 additions and 71,881 deletions.
6 changes: 6 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# prevent git from changing line endings for conan recipes and CMake files,
# since they are hashed to produce a conan recipe revision ID
conanfile.py text eol=lf
CMakeLists.txt text eol=lf
*.cmake text eol=lf
*.in text eol=lf
72 changes: 72 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ "master" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "master" ]
schedule:
- cron: '19 23 * * 3'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'cpp' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

steps:
- name: Checkout repository
uses: actions/checkout@v3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality


# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
10 changes: 5 additions & 5 deletions .github/workflows/frequent_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,12 @@ jobs:
- name: make
run: |
cd build
cmake --build . --config Release -j
cmake --build . --config Release -j 2
cmake --build . --config Release --target install
- name: test
run: |
cd build
ctest -C Release
ctest -C Release --output-on-failure
build-linux:
name: Linux
Expand All @@ -48,9 +47,10 @@ jobs:
- name: make
run: |
cd build
cmake --build . -j
# using the default number of threads (-j) causes G++ to crash
cmake --build . -j 2
cmake --build . --target install
- name: test
run: |
cd build
ctest
ctest --output-on-failure
20 changes: 4 additions & 16 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build, unittest, compress
name: Build, unittest

on:
push:
Expand Down Expand Up @@ -32,13 +32,6 @@ jobs:
run: |
cd build
ctest -C Release
- name: compress
run: Compress-Archive -DestinationPath installWindows-Github.zip -Path build/installWindows-Github
- name: Upload artifact
uses: actions/upload-artifact@v1.0.0
with:
name: windows_install
path: installWindows-Github.zip
build-linux:
name: Linux
Expand All @@ -58,17 +51,12 @@ jobs:
- name: make
run: |
cd build
cmake --build . -j
# using the default number of threads (-j) causes G++ to crash
cmake --build . -j 2
cmake --build . --target install
- name: test
run: |
cd build
ctest
- name: compress
run: tar -czvf installLinux-Github.tar.gz build/installLinux-Github
- name: Upload artifact
uses: actions/upload-artifact@v1.0.0
with:
name: linux_install
path: installLinux-Github.tar.gz
32 changes: 32 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,47 @@
.lock-waf*
.waf-*

# CMake
out/
_deps/
CMakeFiles/
CMakeCache.txt
CMakeSettings.json
build/

externals/coda-oss/modules/c++/**/Makefile
modules/**/Makefile

# Build artifacts
target/
install/
**/install-*/
test_package/build/
*.pyc
*.swp
.depproj
.vs
*.vcxproj.user
**/Debug/
**/Release/
packages/
*.so*
*.a

# Drivers
modules/c/j2k/external/openjpeg/openjpeg-2.0.0/
modules/c/j2k/external/jasper/jasper-1.900.1-mod/
.DS_Store

Makefile
doc/build
bin/
test/unit/CMakeScripts/
libnitf.pc

.idea/
cmake-build*/

# unit tests
outputPathname.ntf
sicd_*_nitf__*_band_*.man
22 changes: 22 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
image: continuumio/anaconda3:5.0.1

before_script:
- python -V # Print out python version for debugging
- echo "deb [check-valid-until=no] http://archive.debian.org/debian jessie-backports main" > /etc/apt/sources.list.d/jessie-backports.list
- sed -i '/deb http:\/\/deb.debian.org\/debian jessie-updates main/d' /etc/apt/sources.list
- apt-get -o Acquire::Check-Valid-Until=false update
- apt-get install -y build-essential
- pip install cython Deprecated==1.1

run:
tags:
- docker
script:
- python waf configure --prefix=install --enable-debugging
- python waf build
- python waf install
- (cd modules/python/cython; python setup.py bdist_wheel)
artifacts:
paths:
- install/*
- modules/python/cython/dist/*.whl
82 changes: 82 additions & 0 deletions .regenerate_python_bindings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
from subprocess import check_output, check_call, DEVNULL
import os
import sys
from platform import dist
from sys import stdout
from threading import Timer, Event
import itertools, sys


def thinking(evt):
def thought():
# https://stackoverflow.com/a/22616059/5401366
spinner = itertools.cycle(["-", "/", "|", "\\"])
while not evt.isSet():
stdout.write(next(spinner)) # write the next character
stdout.flush() # flush stdout buffer (actual character display)
stdout.write("\b") # erase the last written char

return thought


def linux_version():
distro, version, _ = dist()
maj_version = version.split(".")[0]
return distro, maj_version


def swig_version():
decoded_result = check_output(["swig", "-version"]).decode("ascii")
return decoded_result.split("\n")[1].split(" ")[-1]


def python(args):

stdout, stderr = (
(sys.stdout, sys.stderr)
if "DEBUG_PY_BINDINGS" in os.environ
else (DEVNULL, DEVNULL)
)

return check_call([sys.executable] + args.split(" "), stdout=stdout, stderr=stderr)


def main():

(distro, major_version) = linux_version()

if distro != "centos" and major_version != "7":
print(
"Found non-standard os %s{}:%s{}, which may introduce subtle differences in generated code; YMMV"
% (distro, major_version)
)

sv = swig_version()
if sv != "3.0.12":
print("Found unapproved swig version '%s'. Output may vary a great deal!" % sv)

print("Thinking about how great cmake is...")

evt = Event()
thread = Timer(0.7, thinking(evt))
thread.start()

try:
python("waf configure --enable-debugging --prefix=installed --enable-swig")
print("Just")

python("waf build")
print("about")

except Exception as e:
print("Thoughts interrupted by: ")
print(e)
finally:
python("waf distclean")
print("done")

evt.set()


if __name__ == "__main__":
main()
23 changes: 18 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,36 @@ cmake_minimum_required(VERSION 3.14)
project(nitro)

set(CMAKE_C_STANDARD 90)
set(C_STANDARD_REQUIRED true)
set(CMAKE_CXX_STANDARD 11)
set(CXX_STANDARD_REQUIRED true)

if (${CMAKE_PROJECT_NAME} STREQUAL nitro)
# we are the top-level project and are responsible for configuration

# set up warnings
if (MSVC)
# set warning level to /W3
# set warning level to /W4
string(REGEX REPLACE "/W[0-4]" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
string(REGEX REPLACE "/W[0-4]" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
add_compile_options(/W3 /wd4290 /wd4512)
add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS)
add_compile_options(/W4)
add_compile_options(/wd4100) # '...': unreferenced formal parameter
add_compile_options(/wd4127) # conditional expression is constant
if (ENABLE_ASAN)
# https://docs.microsoft.com/en-us/cpp/sanitizers/asan?view=msvc-160
add_compile_options(/fsanitize=address)
endif()
elseif (UNIX)
add_compile_options(
-Wall
-Wno-deprecated
-Wno-unused-value
-Wno-unused-but-set-variable
)
if (ENABLE_ASAN)
# https://gcc.gnu.org/onlinedocs/gcc/Instrumentation-Options.html
add_compile_options(-fsanitize=address)
endif()
endif()

if (EXISTS "${CMAKE_BINARY_DIR}/conan_paths.cmake")
Expand All @@ -36,11 +48,12 @@ if (${CMAKE_PROJECT_NAME} STREQUAL nitro)
set(ENABLE_UUID OFF CACHE BOOL "enable uuid library" FORCE)
set(ENABLE_ZIP OFF CACHE BOOL "enable ZIP library" FORCE)

set(CODA_OSS_DIR "coda-oss")
list(APPEND CMAKE_MODULE_PATH
"${CMAKE_CURRENT_SOURCE_DIR}/externals/coda-oss/cmake")
"${CMAKE_CURRENT_SOURCE_DIR}/externals/${CODA_OSS_DIR}/cmake")
include(CodaBuild)
coda_initialize_build()
add_subdirectory("externals/coda-oss")
add_subdirectory("externals/${CODA_OSS_DIR}")
endif()
endif()

Expand Down
Loading

0 comments on commit 2c7b84b

Please sign in to comment.