Click here to donate to keep PhreeqcUsers open
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email
?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Forum Home
Login
Register
PhreeqcUsers Discussion Forum
»
Beginners
»
Installation questions
»
PhreeqcRM compile error on MacOS
« previous
next »
Print
Pages: [
1
]
Go Down
Author
Topic: PhreeqcRM compile error on MacOS (Read 4543 times)
hjung
Contributor
Posts: 7
PhreeqcRM compile error on MacOS
«
on:
February 12, 2018, 07:23:24 PM »
Hi,
I got this error message when I compile the phreeqcrm library on mac.
**********************************
../src/RM_interface_F.cpp:253:11: error: ordered comparison between pointer and zero ('int *' and 'int')
if (l1 > 0 && *num > 0 && *num <= Reaction_module_ptr->GetComponentCount())
~~ ^ ~
1 error generated.
make[1]: *** [src/RM_interface_F.lo] Error 1
**********************************
After I made 'l1' to '*l1', it compiles but ends with the following comments.
**********************************
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: .libs/libphreeqcrm.a(ChartHandler.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: .libs/libphreeqcrm.a(ChartObject.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: .libs/libphreeqcrm.a(CurveObject.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: .libs/libphreeqcrm.a(ChartHandler.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: .libs/libphreeqcrm.a(ChartObject.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: .libs/libphreeqcrm.a(CurveObject.o) has no symbols
**********************************
When I ran make check command, another error message pops up
**********************************
/Library/Developer/CommandLineTools/usr/bin/make test
CC advection_c.o
../../Tests/advection_c.c:4:10: fatal error: 'malloc.h' file not found
#include <malloc.h>
^~~~~~~~~~
1 error generated.
**********************************
Any suggestion?
Thanks,
hjung
«
Last Edit: February 12, 2018, 07:33:45 PM by hjung
»
Logged
dlparkhurst
Global Moderator
Posts: 3759
Re: PhreeqcRM compile error on MacOS
«
Reply #1 on:
February 12, 2018, 10:20:55 PM »
You are correct, it should be *i1 in that statement.
As for the rest of your errors, it looks like the compillation does not succeed.
Looks like you are running on Linux. What compiler are you using? Did you use configure to generate a Makefile?
Logged
hjung
Contributor
Posts: 7
Re: PhreeqcRM compile error on MacOS
«
Reply #2 on:
February 13, 2018, 12:33:14 AM »
Thanks for the reply Dr. Parkhurst.
I did run configure ("../configure CXX=g++-7") and the following is the final result of the configure.
*************************************
Summary:
C++ Compiler = g++-7
CPPFLAGS =
CXXFLAGS = -g -O2
Fortran Compiler =
Fortran Libs =
LDFLAGS =
Enable OpenMP = yes
Enable MPI = no
*************************************
I'm running on macOS High Sierra version 10.13.3 and "g++-7 -v" command gives this result
*************************************
Using built-in specs.
COLLECT_GCC=g++-7
COLLECT_LTO_WRAPPER=/usr/local/Cellar/gcc/7.3.0/libexec/gcc/x86_64-apple-darwin17.3.0/7.3.0/lto-wrapper
Target: x86_64-apple-darwin17.3.0
Configured with: ../configure --build=x86_64-apple-darwin17.3.0 --prefix=/usr/local/Cellar/gcc/7.3.0 --libdir=/usr/local/Cellar/gcc/7.3.0/lib/gcc/7 --enable-languages=c,c++,objc,obj-c++,fortran --program-suffix=-7 --with-gmp=/usr/local/opt/gmp --with-mpfr=/usr/local/opt/mpfr --with-mpc=/usr/local/opt/libmpc --with-isl=/usr/local/opt/isl --with-system-zlib --enable-checking=release --with-pkgversion='Homebrew GCC 7.3.0' --with-bugurl=https://github.com/Homebrew/homebrew-core/issues --disable-nls
Thread model: posix
gcc version 7.3.0 (Homebrew GCC 7.3.0)
*************************************
Logged
dlparkhurst
Global Moderator
Posts: 3759
Re: PhreeqcRM compile error on MacOS
«
Reply #3 on:
February 13, 2018, 06:07:34 AM »
Try commenting out the include statements for malloc.h in advection_c.c and species_c.c.
Apparently, that header file is now deprecated and should be covered by stdlib.h.
Logged
hjung
Contributor
Posts: 7
Re: PhreeqcRM compile error on MacOS
«
Reply #4 on:
February 13, 2018, 07:00:32 PM »
It seems working after commenting out the statements including malloc.h but now I have another problem.
I'm trying to couple the phreeqcrm library to a transport library, palabos.
running the following command
==============
mpicxx -o plamp_calcite plamp_calcite.o /Users/heewon/work/palabos-v2.0r0/lib/libplb_mpi.a -L/usr/local/lib -lphreeqcrm -v
==============
spits out this error message
==============
Apple LLVM version 9.0.0 (clang-900.0.39.2)
Target: x86_64-apple-darwin17.4.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
"/Library/Developer/CommandLineTools/usr/bin/ld" -demangle -lto_library /Library/Developer/CommandLineTools/usr/lib/libLTO.dylib -dynamic -arch x86_64 -macosx_version_min 10.13.0 -o plamp_calcite -L/usr/local/lib -L/usr/local/opt/libevent/lib -L/usr/local/Cellar/open-mpi/3.0.0_2/lib plamp_calcite.o /Users/heewon/work/palabos-v2.0r0/lib/libplb_mpi.a -lphreeqcrm -lmpi -lc++ -lSystem /Library/Developer/CommandLineTools/usr/lib/clang/9.0.0/lib/darwin/libclang_rt.osx.a
Undefined symbols for architecture x86_64:
"PhreeqcRM::PhreeqcRM(int, int, PHRQ_io*)", referenced from:
_main in plamp_calcite.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
==============
This error is invoked when calling the constructor.
"PhreeqcRM phreeqc_rm(nxyz, nthreads);"
Is this a compatibility issue? If it is, do I need to recompile PhreeqcRM in 32-bit mode?
It would be great if I can have a stepwise guidance.
«
Last Edit: February 13, 2018, 07:57:26 PM by hjung
»
Logged
dlparkhurst
Global Moderator
Posts: 3759
Re: PhreeqcRM compile error on MacOS
«
Reply #5 on:
February 13, 2018, 08:31:38 PM »
Your previous message indicates you compile PhreeqcRM for OpenMP (multithreading) and not MPI (multiprocess). Perhaps that's the problem.
You run the OpenMP version as a normal executable (optional argument is the number of threads to use), but use mpiexec for the MPI version.
If you did compile the OpenMP version, try running it. It is easier to debug OpenMP than MPI.
Logged
hjung
Contributor
Posts: 7
Re: PhreeqcRM compile error on MacOS
«
Reply #6 on:
February 13, 2018, 09:17:45 PM »
Sorry I made the problem complicated, but it doesn't look like the issue of using a different compiler.
Under the same condition with my previous descriptions, running a test file gives a similar error.
g++-7 advection_cpp.cpp -L/usr/local/lib -lphreeqcrm
Undefined symbols for architecture x86_64:
"_main", referenced from:
implicit entry/start for main executable
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
Logged
dlparkhurst
Global Moderator
Posts: 3759
Re: PhreeqcRM compile error on MacOS
«
Reply #7 on:
February 13, 2018, 10:04:54 PM »
advection_cpp.cpp is a subroutine, which is called from main.cpp.
Main also calls subroutines in several other files.
There should be an option in the Make file to test: make check
Directions are in the README file.
Logged
Print
Pages: [
1
]
Go Up
« previous
next »
PhreeqcUsers Discussion Forum
»
Beginners
»
Installation questions
»
PhreeqcRM compile error on MacOS