Skip to content

Commit

Permalink
Fix cd and macos compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
Tanguy Fardet committed Jan 29, 2024
1 parent ea67eab commit 62137a5
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
5 changes: 2 additions & 3 deletions extra/install_debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
sudo apt install cmake g++ python3 python3-dev python3-pip libgeos++-dev doxygen python3-matplotlib python3-tk libboost-dev

# workaround for PyOpenGL
cd /usr/lib/x86_64-linux-gnu
for lg in libglut.so.3.*; do
sudo ln -s "${lg}" libglut.so.3
for lg in /usr/lib/x86_64-linux-gnu/libglut.so.3.*; do
sudo ln -s "${lg}" /usr/lib/x86_64-linux-gnu/libglut.so.3
done

pip3 install --user setuptools
Expand Down
5 changes: 4 additions & 1 deletion extra/install_macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@ echo 'export PATH="/Users/runner/Library/Python/$PYVERSION/bin:$PATH"' >> ~/.bas

export PATH="/Users/runner/Library/Python/$PYVERSION/bin:$PATH"

brew install gcc@13 cmake "python@$PYVERSION" geos doxygen boost libomp
brew install gcc@13 cmake "python@$PYVERSION" geos doxygen boost libomp llvm

brew link gcc@13

export CXX=/usr/local/opt/llvm/bin/clang++
export CC=/usr/local/opt/llvm/bin/clang

pip3 install --user setuptools
pip3 install --user "cython<3"
pip3 install --user numpy scipy pint pyneuroml
Expand Down
18 changes: 9 additions & 9 deletions src/pymodule/setup.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,13 @@ copt = {

lopt = {
'unix': ['-fopenmp'],
'msvc': ['/subsystem:windows', "/debug"],
'msvc': ['/subsystem:windows'],
}

if os_name == "Windows" and ("@CMAKE_BUILD_TYPE@" == "Debug"):
lopt["msvc"].append("/debug")


# custom class

class CustomBuildExt(build_ext):
Expand All @@ -87,15 +91,11 @@ class CustomBuildExt(build_ext):
else:
c = c[0]

cc_var = sysconfig.get_config_var('CC')

if c is None:
# if we really don't get anything, we're probably on windows
c = sysconfig.get_config_var('CC') or "msvc"

if re.match(r"gcc|g\+\+|mingw|clang", c):
c = "unix"
elif "msvc" in c:
c = "msvc"
# normalize names
c = cc_var or self.compiler.compiler_type

c = "msvc" if "msvc" in c else "unix"

try:
Expand Down

0 comments on commit 62137a5

Please sign in to comment.