From 3010995923e09e12bec59398e3caf0f2fae7365d Mon Sep 17 00:00:00 2001 From: vetlewi Date: Thu, 28 Oct 2021 13:21:46 +0200 Subject: [PATCH] Removed `gcc` on macOS I decided that we shouldn't even consider this. Way too much hassel, not any great payout. --- README.md | 2 +- release_note.md | 1 - setup.py | 27 +-------------------------- 3 files changed, 2 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index 7299f2c0..349338d1 100755 --- a/README.md +++ b/README.md @@ -143,7 +143,7 @@ The simplest way to get the new repo is to rerun the installation instructions b The `MaMa` format has some limitation. Mainly the format will not be able to save the `std` attribute, meaning that error-bars will not be stored. The `MaMa` format is always in keV units, meaning that the `units` keyword in the `Vector.save` method is ignored. #### Compiling with `gcc` on macOS -Short answer: Don't. Long answer: If you want to compile using `gcc` you are on your own. This is not a standard setup and will require careful configuration of the system. There is a recent update (PR #191) that will ensure that compilation will complete without any issues, however there may be linking issues at runtime. If you have issues, please consider using the standard `clang` compiler or use the docker image. +Short answer: Don't. Please use `clang`. ## General usage All the functions and classes in the package are available in the main module. You get everything by importing the package diff --git a/release_note.md b/release_note.md index a4b8f9db..1c4c4561 100644 --- a/release_note.md +++ b/release_note.md @@ -12,7 +12,6 @@ Changed: - Reimplemented PPF for normal distribution and truncated normal distribution in C++ for improved performance (about 300% faster than the SciPy implementation!). - Fixed a potential bug where `units` attribute is set erroniously when reading the discrete level density from file (`load_levels_discrete` and `load_levels_discrete_smooth`). - Fixed a bug that prevented compilation on ARM platforms. -- Added a workaround for cases where `gcc` is used rather than `clang` on macOS. This setup will probably still fail on runtime unless the system is correctly configured. That is not our problem, solve it yourself. Deprecated: - `shape` argument of Matrix for creation of a matrix filled with zeros. Use `ZerosMatrix` instead. diff --git a/setup.py b/setup.py index f62f1f1d..f6b8a548 100755 --- a/setup.py +++ b/setup.py @@ -26,17 +26,6 @@ VERSION = '%d.%d.%d' % (MAJOR, MINOR, MICRO) -def check_if_clang_compiler(): - """Check if the compiler is clang or gcc""" - - # Find the CC variable - cc = os.getenv("CC") - cc = 'gcc' if cc is None else cc # Will be gcc if none. - std_err = subprocess.run(cc, capture_output=True, text=True).stderr - if "clang" in std_err: - return True - - # Return the git revision as a string # See also ompy/version.py def git_version(): @@ -146,7 +135,7 @@ def write_version_py(filename='ompy/version_setup.py'): extra_compile_args_cpp = ["-std=c++11", "-O3"] extra_link_args = [] -if openmp and platform.system() == 'Darwin' and check_if_clang_compiler(): +if openmp and platform.system() == 'Darwin': extra_compile_args_cython.insert(-1, "-Xpreprocessor -fopenmp") extra_link_args.insert(-1, "-lomp") elif openmp: @@ -171,20 +160,6 @@ def write_version_py(filename='ompy/version_setup.py'): extra_compile_args=extra_compile_args_cpp) ] -# Superhacky solution to get pybind11 to play nicely with GCC... -if platform.system() == 'Darwin' and not check_if_clang_compiler(): - try: - idx = ext_modules_pybind11[0].extra_compile_args.index( - '-stdlib=libc++') - del ext_modules_pybind11[0].extra_compile_args[idx] - except ValueError: - pass - try: - idx = ext_modules_pybind11[0].extra_link_args.index('-stdlib=libc++') - del ext_modules_pybind11[0].extra_link_args[idx] - except ValueError: - pass - install_requires = [ "cython", "numpy>=1.20.0",