Skip to content

Commit

Permalink
Merge branch 'develop' into 'main'
Browse files Browse the repository at this point in the history
Update main branch to GDX release 7.11.1 (should propagate to products and GitHub)

See merge request devel/gdx!45
  • Loading branch information
0x17 committed Feb 28, 2024
2 parents 29c12a0 + 708850f commit afb6a38
Show file tree
Hide file tree
Showing 41 changed files with 1,348 additions and 252 deletions.
25 changes: 17 additions & 8 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ apigenerator:
script:
- mkdir -p apifiles
- python3 src/yaml2doxy.py --input src/gdxapi.yaml --template_folder src/templates --output apifiles/gdx.h
- python3 src/yaml2cwrap.py --input src/gdxapi.yaml --template_folder src/templates --output apifiles/cwrap.hpp
- python3 src/yaml2cwrap.py --input src/gdxapi.yaml --template_folder src/templates --output apifiles/gdxcwrap.hpp
- >
python3
src/yaml2cwrap.py
Expand All @@ -72,7 +72,7 @@ apigenerator:
- cp src/apigenerator/include/gc*.h apifiles
- cp src/gdx.h generated/gdx.h
- |
for f in "gdxcc.h" "gdxcc.c" "gdxcclib.cpp" "gclgms.h" "gdx.h" "cwrap.hpp" "gdxcppwrap.h"; do
for f in "gdxcc.h" "gdxcc.c" "gdxcclib.cpp" "gclgms.h" "gdx.h" "gdxcwrap.hpp" "gdxcppwrap.h"; do
echo "Diffing 'apifiles/$f' with 'generated/$f'"
if ! diff apifiles/$f generated/$f; then
echo "Warning: $f stored in repo and freshly generated differ!"
Expand Down Expand Up @@ -110,10 +110,11 @@ build-leg:
- cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON CMakeLists.txt
- cmake --build . 2>&1 | tee build_log.txt
- python3 ci/report_for_log.py gcc build_log.txt warnings.xml
- mv libgdx-static.a libgdx-linux.a
needs: [fetch-ci-scripts,apigenerator]
artifacts:
name: gdx-leg
paths: [gdxtest,gdxwraptest,libgdxcclib64.so]
paths: [gdxtest,gdxwraptest,libgdxcclib64.so,libgdx-linux.a]
expire_in: 2 hours
reports:
junit: warnings.xml
Expand Down Expand Up @@ -143,10 +144,11 @@ build-deg:
- cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DCMAKE_CXX_COMPILER=clang++ CMakeLists.txt
- cmake --build . 2>&1 | tee build_log.txt
- python3 ci/report_for_log.py clang build_log.txt warnings.xml
- mv libgdx-static.a libgdx-macos.a
needs: [fetch-ci-scripts,apigenerator]
artifacts:
name: gdx-deg
paths: [gdxtest,gdxwraptest,libgdxcclib64.dylib]
paths: [gdxtest,gdxwraptest,libgdxcclib64.dylib,libgdx-macos.a]
expire_in: 2 hours
reports:
junit: warnings.xml
Expand All @@ -155,14 +157,20 @@ build-dac:
stage: build
tags: [macos-arm64]
script:
- mv libgdxcclib64.dylib libgdxcclib64_deg.dylib
- mv libgdx-macos.a libgdx-macos-deg.a
- cp apifiles/* src/
- cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DCMAKE_CXX_COMPILER=clang++ CMakeLists.txt
- cmake --build . 2>&1 | tee build_log.txt
- python3 ci/report_for_log.py clang build_log.txt warnings.xml
needs: [fetch-ci-scripts,apigenerator]
- mv libgdxcclib64.dylib libgdxcclib64_dac.dylib
- mv libgdx-static.a libgdx-macos-dac.a
- lipo -create libgdxcclib64_deg.dylib libgdxcclib64_dac.dylib -output libgdxcclib64.dylib
- lipo -create libgdx-macos-deg.a libgdx-macos-dac.a -output libgdx-macos.a
needs: [fetch-ci-scripts,apigenerator,build-deg]
artifacts:
name: gdx-dac
paths: [gdxtest,gdxwraptest,libgdxcclib64.dylib]
paths: [gdxtest,gdxwraptest,libgdxcclib64.dylib,libgdx-macos.a]
expire_in: 2 hours
reports:
junit: warnings.xml
Expand Down Expand Up @@ -345,7 +353,7 @@ deploy-gitlab-github:
- if: $CI_COMMIT_BRANCH == 'main'
when: on_success
tags: [linux]
needs: [build-leg, build-dac, build-wei, apigenerator]
needs: [build-leg,build-dac,build-wei,apigenerator]
image:
name: registry.gams.com/devel/gdx/leg/builder-deploy:latest
entrypoint: [""] # prevent startup.sh
Expand All @@ -366,8 +374,9 @@ deploy-gitlab-github:
-n "${GDX_RELEASE_NAME}"
- sleep 10s # make sure the release is available to reference
- cp Release/gdxcclib64.dll apifiles/*.h apifiles/*.c apifiles/*.cpp .
- cp Release/gdx-static.lib libgdx-windows.lib
- |
for fn in libgdxcclib64.so gdxcclib64.dll libgdxcclib64.dylib gclgms.h gcmutex.h gdxcc.h gdxcc.c gdxcclib.cpp
for fn in libgdxcclib64.so gdxcclib64.dll libgdxcclib64.dylib libgdx-macos.a libgdx-linux.a libgdx-windows.lib gclgms.h gcmutex.h gdxcc.h gdxcc.c gdxcwrap.hpp gdxcclib.cpp
do
GITHUB_TOKEN=${GITHUB_TOKEN} github-release -v upload -R -u GAMS-dev -r gdx -t "${GDX_TAG_NAME}" -n $fn -f $fn
done
Expand Down
58 changes: 44 additions & 14 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,12 @@ if (MSVC)
endif (MSVC)

if (UNIX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wreturn-type -Wmissing-declarations -Wno-unknown-pragmas")
endif (UNIX)

if (APPLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wreturn-type -Wmissing-declarations -Wno-unknown-pragmas")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DZ_HAVE_UNISTD_H")
elseif(UNIX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wformat-truncation=0")
endif (APPLE)
if(NOT APPLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wformat-truncation=0")
endif (NOT APPLE)
endif (UNIX)

set(common
src/gmsstrm.h src/gmsstrm.cpp
Expand Down Expand Up @@ -65,12 +63,14 @@ set(tests
src/tests/datastoragetests.cpp
)

set(inc-dirs zlib src generated)

# Dynamic library / shared object
add_library(gdxcclib64 SHARED ${common} generated/gdxcclib.cpp )
if(UNIX)
target_compile_options(gdxcclib64 PRIVATE -fvisibility=hidden)
endif()
target_include_directories(gdxcclib64 PRIVATE zlib src generated)
target_include_directories(gdxcclib64 PRIVATE ${inc-dirs})
if (APPLE)
set(cclib-link-options "-Bdynamic")
elseif(UNIX) # Linux
Expand All @@ -81,10 +81,15 @@ endif()
target_link_libraries(gdxcclib64 ${mylibs} ${cclib-link-options})
set_property(TARGET gdxcclib64 PROPERTY POSITION_INDEPENDENT_CODE ON)

# Static library
add_library(gdx-static STATIC ${common})
target_include_directories(gdx-static PRIVATE ${inc-dirs})
set_property(TARGET gdx-static PROPERTY POSITION_INDEPENDENT_CODE ON)

# Unit test suite (against statically compiled GDX)
add_executable(gdxtest ${common} ${tests})
target_include_directories(gdxtest PRIVATE zlib src generated)
target_link_libraries(gdxtest ${mylibs})
add_executable(gdxtest ${tests})
target_include_directories(gdxtest PRIVATE ${inc-dirs})
target_link_libraries(gdxtest gdx-static ${mylibs})

# Compare against Delphi reference behavior when running against GDX performance library files
if(UNIX)
Expand All @@ -95,7 +100,7 @@ endif()
if(EXISTS ${gams43-apifiles-path}gdxcc.c)
add_executable(delphi-diff-tests ${common} src/tests/doctestmain.cpp
src/tests/delphidifftests.cpp ${gams43-apifiles-path}gdxcc.c)
target_include_directories(delphi-diff-tests PRIVATE zlib src generated)
target_include_directories(delphi-diff-tests PRIVATE ${inc-dirs})
target_link_libraries(delphi-diff-tests ${mylibs})
if(UNIX)
target_compile_options(delphi-diff-tests PRIVATE -DGC_NO_MUTEX)
Expand All @@ -115,10 +120,35 @@ target_compile_options(gdxwraptest PRIVATE -DGXFILE_CPPWRAP -DGC_NO_MUTEX)

# Standalone GDX example program 1
add_executable(xp_example1 ${common} src/examples/xp_example1.cpp)
target_include_directories(xp_example1 PRIVATE zlib src generated)
target_include_directories(xp_example1 PRIVATE ${inc-dirs})
target_link_libraries(xp_example1 ${mylibs})

# Standalone GDX example program 2
add_executable(xp_example2 ${common} src/examples/xp_example2.cpp generated/optcc.c)
target_include_directories(xp_example2 PRIVATE zlib src generated)
target_include_directories(xp_example2 PRIVATE ${inc-dirs})
target_link_libraries(xp_example2 ${mylibs})

# Standalone GDX example program 3 (associative "supply.demand" str -> double (level))
add_executable(xp_associative ${common} src/examples/xp_associative.cpp)
target_include_directories(xp_associative PRIVATE ${inc-dirs})
target_link_libraries(xp_associative ${mylibs})

# Standalone GDX example program 4 (associative {supply,demand} vector -> double (level))
add_executable(xp_associative_vec ${common} src/examples/xp_associative_vec.cpp)
target_include_directories(xp_associative_vec PRIVATE ${inc-dirs})
target_link_libraries(xp_associative_vec ${mylibs})

# Standalone GDX example program 5 (data write)
if(UNIX)
set(cur-apifiles-path /home/andre/gamsdist/apifiles/C/api/)
else()
set(cur-apifiles-path C:/GAMS/46/apifiles/C/api/)
endif()
if(EXISTS ${cur-apifiles-path}gmdcc.c)
add_executable(xp_dataWrite ${common} src/examples/xp_dataWrite.cpp ${cur-apifiles-path}gmdcc.c)
target_include_directories(xp_dataWrite PRIVATE ${inc-dirs} ${cur-apifiles-path})
target_link_libraries(xp_dataWrite ${mylibs})
if(UNIX)
target_compile_options(xp_dataWrite PRIVATE -DGC_NO_MUTEX)
endif()
endif()
Loading

0 comments on commit afb6a38

Please sign in to comment.