Skip to content
Snippets Groups Projects
Commit 32a5193f authored by Giovanni Bussi's avatar Giovanni Bussi
Browse files

Fixed building python module with clang 8.0

C++20 has an include file named 'version' that is included in
cstddef with `include <version>'.

On OSX, case insensitive, file python/VERSION is included by mistake.
The problem appears when compiling with clang 8.

I noticed this when building conda package on travis, but it can be
reproduced e.g. using

cd python && make clean && make pip && CC=clang-mp-8.0 python3.7 setup.py build_ext -i

I fixed this putting Plumed.h in a separate directory
parent 07c5ebf0
No related branches found
No related tags found
No related merge requests found
include VERSION
include Plumed.h
include include/Plumed.h
include plumed.pyx
include cplumed.pxd
......@@ -28,8 +28,9 @@ all:
endif
pip:
cp ../src/wrapper/Plumed.h .
cp ../VERSION .
mkdir -p include
cp ../src/wrapper/Plumed.h include/
ifndef python_bin
python_bin=python
......@@ -39,10 +40,12 @@ endif
pypi:
mkdir -p pypi
mkdir -p pypi/include
cp -r test pypi/
cp ../src/wrapper/Plumed.h README.rst MANIFEST.in cplumed.pxd plumed.pyx setup.py ../VERSION pypi/
cp ../src/wrapper/Plumed.h pypi/include/
cp README.rst MANIFEST.in cplumed.pxd plumed.pyx setup.py ../VERSION pypi/
cd pypi ; $(python_bin) setup.py sdist
echo "now use: $(python_bin) -m twine upload dist/plumed-$(VERSION).tar.gz"
clean:
rm -fr *.so plumed.cpp build Plumed.h VERSION pypi test/logfile test/bck* pypi
rm -fr *.so plumed.cpp build Plumed.h VERSION pypi test/logfile test/bck* pypi include
......@@ -39,7 +39,11 @@ def is_platform_mac():
if os.getenv("plumed_macports") is not None:
copyfile("../VERSION","VERSION")
copyfile("../src/wrapper/Plumed.h","Plumed.h")
try:
os.mkdir("include")
except OSError:
pass
copyfile("../src/wrapper/Plumed.h","include/Plumed.h")
plumedname = os.getenv("plumed_program_name")
if plumedname is None:
......@@ -80,7 +84,7 @@ def readme():
try:
include_dirs=[os.environ["plumed_include_dir"]]
except KeyError:
include_dirs=["."]
include_dirs=["./include"]
# allow one to force using cython with env var plumed_force_cython=yes
USE_CYTHON = False
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment