Closed sealauren closed 4 years ago
These errors arise because the code was written in C initially, where assigning voids from memory allocations to other types is allowed without casting them first. The -fpermissive flag should cause these to go away (in lieu of rewriting each allocation in a C++ friendly manner, which will happen eventually).
If you are compiling on your Mac using Apple's gcc/LLVM, sometimes strange things can happen when you also have updated std libraries potentially from homebrew/macports.
The code compiles fine for me on my Mac if I use a g++ version which is entirely installed via macports, e.g.:
$ g++-mp-7 -w -O3 -o lcout -I/opt/local/include -I/opt/local/lib -I/Users/seanmills/celerite/cpp/include -I/Users/seanmills/celerite/cpp/lib/eigen_3.3.3 -lm -L/opt/local/lib -lgsl -lgslcblas -fpermissive phodymm.cpp
where
$ g++-mp-7 --version
g++-mp-7 (MacPorts gcc7 7.3.0_5) 7.3.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
as opposed to using the default g++
:
$ g++ --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 9.0.0 (clang-900.0.38)
Target: x86_64-apple-darwin17.7.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
If you know what you're doing with Mac compiler libraries (or I fix the code), you can avoid having to do this, but this is a simple workaround until then. Let me know if you find any other problems--I have never tried to compile it on a Mac until now, so didn't know to expect this.
Hi Sean,
I don't have macports installed, and I cannot find g++ on homebrew.
Can you please fix your code?
Thanks,
Lauren
On Fri, Dec 21, 2018 at 6:32 AM smmills notifications@github.com wrote:
These errors arise because the code was written in C initially, where assigning voids from memory allocations to other types is allowed without casting them first. The -fpermissive flag should cause these to go away (in lieu of rewriting each allocation in a C++ friendly manner, which will happen eventually).
If you are compiling on your Mac using Apple's gcc/LLVM, sometimes strange things can happen when you also have updated std libraries potentially from homebrew/macports.
The code compiles fine for me on my Mac if I use a g++ version which is entirely installed via macports, e.g.: $ g++-mp-7 -w -O3 -o lcout -I/opt/local/include -I/opt/local/lib -I/Users/seanmills/celerite/cpp/include -I/Users/seanmills/celerite/cpp/lib/eigen_3.3.3 -lm -L/opt/local/lib -lgsl -lgslcblas -fpermissive phodymm.cpp where
$ g++-mp-7 --version g++-mp-7 (MacPorts gcc7 7.3.0_5) 7.3.0 Copyright (C) 2017 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
as opposed to using the default g++:
$ g++ --version Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 Apple LLVM version 9.0.0 (clang-900.0.38) Target: x86_64-apple-darwin17.7.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
If you know what you're doing with Mac compiler libraries (or I fix the code), you can avoid having to do this, but this is a simple workaround until then. Let me know if you find any other problems--I have never tried to compile it on a Mac until now, so didn't know to expect this.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/smmills/Phodymm/issues/16#issuecomment-449434861, or mute the thread https://github.com/notifications/unsubscribe-auth/ABRTfgAPc8gjbja8zySlM8RH1pMvqHV8ks5u7Q0bgaJpZM4ZdKyM .
Homebrew has many versions of gcc, including gcc4, 5, 6, 7, and gcc8; see, e.g., https://formulae.brew.sh/formula/ for a list of packages available.
You will probably want to use the code on a cluster anyway, so it may not be worth pursuing it on your laptop if it's a hassle for you. You might instead go directly to compiling on Cadence or wherever. Otherwise, the code will be updated in a few weeks probably.
I'll try installing it on cadence. How do I install gsl on cadence?
On Fri, Dec 21, 2018 at 3:20 PM smmills notifications@github.com wrote:
Homebrew has many versions of gcc, including gcc4, 5, 6, 7, and gcc8; see, e.g., https://formulae.brew.sh/formula/ for a list of packages available.
You will probably want to use the code on a cluster anyway, so it may not be worth pursuing it on your laptop if it's a hassle for you. You might instead go directly to compiling on Cadence or wherever. Otherwise, the code will be updated in a few weeks probably.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/smmills/Phodymm/issues/16#issuecomment-449534361, or mute the thread https://github.com/notifications/unsubscribe-auth/ABRTflNSReIB3m5JTCNjKtAbV08X7pHyks5u7YjegaJpZM4ZdKyM .
I think gcc and gsl are installed on Cadence systemwide already.
Hey Sean,
I just downloaded and installed gsl and celerite. However, when I tried to compile your code, I got the following errors:
g++ -w -O3 -o lcout -I/$HOME/celerite/cpp/include -I/$HOME/celerite/cpp/lib/eigen_3.3.3 -lm -lgsl -lgslcblas -fpermissive phodymm.cpp