Commit cfcff1e1 authored by jouke's avatar jouke
Browse files

more flexible python versioning so hopefull build will not fail with new

ubuntu 26.04
parent b1f74030
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -12,7 +12,7 @@ build_linux:
  stage: build
  needs: []
  script:
    - apt-get install -y -qq gcc g++ make python3.12-dev
    - apt-get install -y -qq gcc g++ make python3-dev
    - ./build.sh
  artifacts:
    paths:
@@ -34,7 +34,7 @@ testEngine:
  stage: test
  needs: ["build_linux"]
  script:
    - apt install -y -qq  libpython3.12-dev
    - apt install -y -qq  libpython3-dev
    - ./runTestsEngine.sh

testModules:
@@ -45,7 +45,7 @@ testModules:
  script:
    - mkdir -p /root/.aws/
    - echo region = us-west-2 >> /root/.aws/credentials
    - apt install -y -qq  bc r-cran-xml libpython3.12-dev
    - apt install -y -qq  bc r-cran-xml libpython3-dev
    - ./runTestsModules.sh

pages:
+8 −3
Original line number Diff line number Diff line
@@ -25,6 +25,11 @@ GW_BIN := $(GW_BUILD_DIR)OpenSimRoot_graphWriting
DEBUG_BIN := $(DEBUG_BUILD_DIR)OpenSimRoot_debug
WIN_BIN := $(WIN_BUILD_DIR)OpenSimRoot.exe

# python version
python_version_full := $(wordlist 2,4,$(subst ., ,$(shell python3 --version 2>&1)))
python_version_major := $(word 1,${python_version_full})
python_version_minor := $(word 2,${python_version_full})
python_version_patch := $(word 3,${python_version_full})

## Set compiler options

@@ -39,8 +44,8 @@ CXXWIN := x86_64-w64-mingw32-g++
# -c: compile only; we'll link in a separate step
# -W: enable compiler warnings
# -fmessage-length=0: Don't insert linebreaks into error messages
CXXFLAGS =  -I/usr/include/python3.12 -std=c++23 -DGITHASH='$(GIT_HASH)' -O3 -Wall -c -fmessage-length=0 
CXXFLAGSWIN =  -I/usr/include/python3.12 -std=c++23 -DGITHASH='$(GIT_HASH)' -O3 -Wall -c -fmessage-length=0 
CXXFLAGS =  -I/usr/include/python3.$(python_version_minor) -std=c++23 -DGITHASH='$(GIT_HASH)' -O3 -Wall -c -fmessage-length=0 
CXXFLAGSWIN =  -I/usr/include/python3.$(python_version_minor) -std=c++23 -DGITHASH='$(GIT_HASH)' -O3 -Wall -c -fmessage-length=0 
# -g: include debug symbols
# -Og: include some speed optimizations but none that make debugger output confusing
CXXFLAGS_DEBUG = $(subst -O3, -Og -g, $(CXXFLAGS))
@@ -158,7 +163,7 @@ $(GW_BIN): $(OBJECTS_GW) | $(GW_BUILD_DIR)
$(WIN_BIN): $(OBJECTS_WIN) | $(WIN_BUILD_DIR)
	$(CXXWIN) -o $@ $+ -lpsapi -lcomdlg32 -static-libstdc++ -static-libgcc 
$(DEBUG_BIN): $(OBJECTS_DEBUG) | $(DEBUG_BUILD_DIR)
	$(CXX) -g -o $@ $+ -lpython3.12 
	$(CXX) -g -o $@ $+ -lpython3.$(python_version_minor) 

# Each dependency file contains Make directives that specify which headers are included in which objects.
# We include them here as if we'd typed them out for ourselves.