Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 09f1303e authored by hhakim's avatar hhakim
Browse files

Add LINUX_DEFAULT_COMPILER_FOR_PYTHON cmake option + doc.

[skip ci].
parent 62f22646
No related branches found
No related tags found
No related merge requests found
......@@ -245,6 +245,7 @@ option(BUILD_EIGTJ_SVDTJ "if OFF the eigjt and svdtj C++ implementations are not
option(MATLAB_2017_API "if ON the deprecated Matlab API will be used to build -- including separate complex API instead of new interleaved complex (R2018a)" OFF)
option(VCOMPLIB_PATH "Set the library path of OpenMP which comes from the Visual Studio environment, e.g. C:/Program Files (x86)/Microsoft Visual Studio/*/vcomp140.dll")
option(NO_MATIO "Avoid using MAT-IO library to implement reading/writing of FAµST matrices." OFF)
option(LINUX_DEFAULT_COMPILER_FOR_PYTHON "Avoid using automatically clang for Linux and use most likely gcc." OFF)
if (BUILD_USE_SINGLEPRECISION)
message(STATUS "**********SINGLEPRECISION ACTIF************")
......
......@@ -81,6 +81,7 @@ Quick Build of the python wrappers (pyfaust) on UNIX (without MATLAB and MATIO)
mkdir build
cd build
cmake -DBUILD_WRAPPER_PYTHON=ON -DNO_MATIO=ON -DNOCPPTESTS=ON ..
# on Linux if clang compiler is not installed add the cmake option -DLINUX_DEFAULT_COMPILER_FOR_PYTHON=ON to defaulty use gcc
make faust_python
---
......
......@@ -12,6 +12,8 @@ from glob import glob
version = '@CPACK_PACKAGE_VERSION@'
LINUX_DEFAULT_COMPILER_FOR_PYTHON = '@LINUX_DEFAULT_COMPILER_FOR_PYTHON@'
if(version == ''):
version = '0.0.0' # typically when compiling just for testing
# (not for packaging with a proper version)
......@@ -21,12 +23,13 @@ from sys import platform
lib_ext = 'so'
extra_link_args = [@FAUST_SETUP_PY_LFLAGS@]
extra_objects = @PYTHON_EXT_EXTRA_OBJECTS@
if platform == "linux":# or platform == "darwin":
# compile with clang on Linux (and MacOS X, this is the default choice)
from distutils import sysconfig
sysconfig.get_config_vars()['CC'] = 'clang++'
sysconfig.get_config_vars()['CXX'] = 'clang++'
sysconfig.get_config_vars()['LDCXXSHARED'] = 'clang++ -shared -fopenmp'
if platform == "linux":
if LINUX_DEFAULT_COMPILER_FOR_PYTHON == 'OFF':# or platform == "darwin":
# compile with clang on Linux (and MacOS X, this is the default choice)
from distutils import sysconfig
sysconfig.get_config_vars()['CC'] = 'clang++'
sysconfig.get_config_vars()['CXX'] = 'clang++'
sysconfig.get_config_vars()['LDCXXSHARED'] = 'clang++ -shared -fopenmp'
for opt in [@FAUST_SETUP_PY_LFLAGS@]+[]:
if '-fopenmp' not in extra_link_args and opt.find('-fopenmp'):
extra_link_args.append('-fopenmp') # because the LDCXXSHARED modif above is not enough (distutils ignores the -fopenmp flag)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment