PhreeqcUsers Discussion Forum

Registrations currently disabled due to excessive spam. Please email phreeqcusers at gmail.com to request an account.
Welcome Guest
 

  • Forum Home
  • Login
  • Register

  • PhreeqcUsers Discussion Forum »
  • Beginners »
  • Installation questions »
  • PhreeqcRM: Testsuite Fail
« previous next »
  • Print
Pages: [1]   Go Down

Author Topic: PhreeqcRM: Testsuite Fail  (Read 7276 times)

kayakernate

  • Frequent Contributor
  • Posts: 11
PhreeqcRM: Testsuite Fail
« on: 14/07/20 19:27 »
Dear Dr. Parkhurst,

Hello! My name is Nathan. I am an undergrad at the University of Oregon and I’m currently trying to set up PhreeqcRM for an independent C++ project.

I am currently trying to build the PhreeqcRM module from source. My system is macOS Catalina 10.15.5. I am following these instructions: https://water.usgs.gov/water-resources/software/PHREEQC/README.PhreeqcRM.12927.TXT

I have opened the tarball file, and I have created the Release_openmp directory. I have executed ../configure from within that directory, and everything came back great. I ran "make", and I had no errors. But then I ran "make check":

Code: [Select]
Making check in database
make[1]: Nothing to be done for `check'.
Making check in doc
make[1]: Nothing to be done for `check'.
Making check in Doxygen
make[1]: Nothing to be done for `check'.
Making check in Tests
/Applications/Xcode.app/Contents/Developer/usr/bin/make  test
  CC       advection_c.o
  CXX      advection_cpp.o
  CXX      main.o
  CC       species_c.o
  CXX      species_cpp.o
  GEN      test
/Applications/Xcode.app/Contents/Developer/usr/bin/make  check-TESTS
../../config/test-driver: line 107: 50263 Abort trap: 6           "$@" > $log_file 2>&1
FAIL: test
============================================================================
Testsuite summary for PhreeqcRM 3.6.2-15100
============================================================================
# TOTAL: 1
# PASS:  0
# SKIP:  0
# XFAIL: 0
# FAIL:  1
# XPASS: 0
# ERROR: 0
============================================================================
See Tests/test-suite.log
Please report to dlpark@usgs.gov
============================================================================
make[3]: *** [test-suite.log] Error 1
make[2]: *** [check-TESTS] Error 2
make[1]: *** [check-am] Error 2
make: *** [check-recursive] Error 1

It advised me to report this to you. Would you be able to clarify what I am doing wrong?
I am very new to PHREEQC, so any tips and pointers to resources are greatly appreciated.

Best,
Nathan
« Last Edit: 21/07/20 17:35 by kayakernate »
Logged

kayakernate

  • Frequent Contributor
  • Posts: 11
Re: PhreeqcRM: Testsuite Fail
« Reply #1 on: 21/07/20 17:47 »
Follow up: I tried redownloading it and going through the process again and I noticed that when I run make for the first time in the Release_openmp directory I get all these warnings:

Code: [Select]
../src/IPhreeqcPhast/IPhreeqc/phreeqcpp/print.cpp:1486:67: warning: illegal character encoding in string literal [-Winvalid-source-encoding]
                           "Molality", "Activity", "Molality", "Activity", "Gamma", "cm<B3>/mol"));
                                                                                       ^~~~
../src/IPhreeqcPhast/IPhreeqc/phreeqcpp/print.cpp:1654:46: warning: illegal character encoding in string literal [-Winvalid-source-encoding]
                                output_msg(sformatf("\t%11.3e  sigma, C/m<B2>\n",
                                                                         ^~~~
../src/IPhreeqcPhast/IPhreeqc/phreeqcpp/print.cpp:1665:49: warning: illegal character encoding in string literal [-Winvalid-source-encoding]
                                output_msg(sformatf("\tundefined  sigma, C/m<B2>\n"));
                                                                            ^~~~
../src/IPhreeqcPhast/IPhreeqc/phreeqcpp/print.cpp:1687:37: warning: illegal character encoding in string literal [-Winvalid-source-encoding]
                                                   "\t%11.3e  specific area, m<B2>/mol %s\n",
                                                                              ^~~~
../src/IPhreeqcPhast/IPhreeqc/phreeqcpp/print.cpp:1695:22: warning: illegal character encoding in string literal [-Winvalid-source-encoding]
                                                   "\t%11.3e  m<B2> for %11.3e moles of %s\n\n",
                                                               ^~~~
../src/IPhreeqcPhast/IPhreeqc/phreeqcpp/print.cpp:1708:37: warning: illegal character encoding in string literal [-Winvalid-source-encoding]
                                                   "\t%11.3e  specific area, m<B2>/mol %s\n",
                                                                              ^~~~
../src/IPhreeqcPhast/IPhreeqc/phreeqcpp/print.cpp:1716:22: warning: illegal character encoding in string literal [-Winvalid-source-encoding]
                                                   "\t%11.3e  m<B2> for %11.3e moles of %s\n\n",
                                                               ^~~~
../src/IPhreeqcPhast/IPhreeqc/phreeqcpp/print.cpp:1729:37: warning: illegal character encoding in string literal [-Winvalid-source-encoding]
                                                   "\t%11.3e  specific area, m<B2>/g\n",
                                                                              ^~~~
../src/IPhreeqcPhast/IPhreeqc/phreeqcpp/print.cpp:1735:37: warning: illegal character encoding in string literal [-Winvalid-source-encoding]
                                output_msg(sformatf("\t%11.3e  m<B2> for %11.3e g\n\n",
                                                                ^~~~
../src/IPhreeqcPhast/IPhreeqc/phreeqcpp/print.cpp:1951:40: warning: illegal character encoding in string literal [-Winvalid-source-encoding]
                                                   "\t%11.3e  sigma, plane 0, C/m<B2>\n",
                                                                                 ^~~~
../src/IPhreeqcPhast/IPhreeqc/phreeqcpp/print.cpp:1958:40: warning: illegal character encoding in string literal [-Winvalid-source-encoding]
                                                   "\t%11.3e  sigma, plane 1, C/m<B2>\n",
                                                                                 ^~~~
../src/IPhreeqcPhast/IPhreeqc/phreeqcpp/print.cpp:1965:40: warning: illegal character encoding in string literal [-Winvalid-source-encoding]
                                                   "\t%11.3e  sigma, plane 2, C/m<B2>\n",
                                                                                 ^~~~
../src/IPhreeqcPhast/IPhreeqc/phreeqcpp/print.cpp:1972:46: warning: illegal character encoding in string literal [-Winvalid-source-encoding]
                                                   "\t%11.3e  sigma, diffuse layer, C/m<B2>\n\n",
                                                                                       ^~~~
../src/IPhreeqcPhast/IPhreeqc/phreeqcpp/print.cpp:1981:49: warning: illegal character encoding in string literal [-Winvalid-source-encoding]
                                output_msg(sformatf("\tundefined  sigma, C/m<B2>\n"));
                                                                            ^~~~
../src/IPhreeqcPhast/IPhreeqc/phreeqcpp/print.cpp:2239:31: warning: illegal character encoding in string literal [-Winvalid-source-encoding]
                                   "Specific Conductance (<B5>S/cm, ", tc_x, "<B0>C)  = ", (int) SC));
                                                          ^~~~
../src/IPhreeqcPhast/IPhreeqc/phreeqcpp/print.cpp:2239:48: warning: illegal character encoding in string literal [-Winvalid-source-encoding]
                                   "Specific Conductance (<B5>S/cm, ", tc_x, "<B0>C)  = ", (int) SC));
                                                                              ^~~~
../src/IPhreeqcPhast/IPhreeqc/phreeqcpp/print.cpp:2249:50: warning: illegal character encoding in string literal [-Winvalid-source-encoding]
                output_msg(sformatf("%45s%9.5f", "Density (g/cm<B3>)  = ",
                                                               ^~~~
../src/IPhreeqcPhast/IPhreeqc/phreeqcpp/print.cpp:2303:51: warning: illegal character encoding in string literal [-Winvalid-source-encoding]
        output_msg(sformatf("%45s%6.2f\n", "Temperature (<B0>C)  = ",

After the process is done and I run "make check" I get the exact same error.

Any help is greatly appreciated.
« Last Edit: 21/07/20 17:48 by kayakernate »
Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 4074
Re: PhreeqcRM: Testsuite Fail
« Reply #2 on: 21/07/20 18:06 »
I thought I posted a reply, but I guess it didn't make it.

Try replacing a line in PhreeqcRM.cpp at about line 8473.

Old line:
//j = backward_mapping_root[0];         /* j is nxyz number */

New line:
j = backward_mapping[0];         /* j is nxyz number */

I'm not sure if this will work. Alternatively, you can try using the define USE_OPENMP.

We will try to get a revised version on the web site, but it may take a while.
Logged

kayakernate

  • Frequent Contributor
  • Posts: 11
Re: PhreeqcRM: Testsuite Fail
« Reply #3 on: 21/07/20 20:26 »
Dear Dr. Parkhurst,

Thank you very much for your response!

Here is what I saw in the source code at line 8472, it looks a little different from what you said - backward_mapping_root appears to be a 2D array in my version:

Code: [Select]
#else
                                //j = backward_mapping_root[i][0];                   /* j is nxyz number */
                                phast_iphreeqc_worker->Get_cell_clock_times().push_back(- (double) CLOCK());
                                local_chem_mask = this->print_chem_mask_root[j];

Here's what I changed it to:

Code: [Select]
#else
                                j = backward_mapping[i][0];                   /* j is nxyz number */
                                phast_iphreeqc_worker->Get_cell_clock_times().push_back(- (double) CLOCK());
                                local_chem_mask = this->print_chem_mask_root[j];

I went back to the Release_openmp directory, I reconfigured (../configure), remade (make), and ran make check. Still get the same error.

Code: [Select]
../../config/test-driver: line 107: 61213 Abort trap: 6           "$@" > $log_file 2>&1
FAIL: test
============================================================================
Testsuite summary for PhreeqcRM 3.6.2-15100
============================================================================
# TOTAL: 1
# PASS:  0
# SKIP:  0
# XFAIL: 0
# FAIL:  1
# XPASS: 0
# ERROR: 0
============================================================================
See Tests/test-suite.log
Please report to dlpark@usgs.gov
============================================================================

I then changed the code back to what it was before.

I'm not sure what you mean by using the define USE_OPENMP. I see the ifdef statement in the code:

Code: [Select]
#if defined(USE_OPENMP)
#include <omp.h>

And I see that USE_OPENMP is not defined anywhere in the file. What would I define this to be? The directory where my omp.h file is?
Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 4074
Re: PhreeqcRM: Testsuite Fail
« Reply #4 on: 21/07/20 21:25 »
I'm not sure how you compiled PhreeqcRM. Did you use CMake to generate a Makefile?

The latest errors are related to another define used in #ifdef statements. You need to use NO_UTF8_ENCODING.

In Makefiles, you need -DNO_UTF8_ENCODING to avoid the errors about illegal characters.

Similarly, -DUSE_OPENMP would compile the OpenMP version of PhreeqcRM.

If you used CMake, I think it should have determined the right settings for the encoding issue, and in your first post, you did not show these illegal character errors.

I think by default, CMake would compile for for OpenMP. The code change I suggested would not make a difference; it only applied if you were using neither OpenMP nor MPI.

Going all the way back to the beginning, I think you may have successfully generated the PhreeqcRM library, PhreeqcRM.lib. If you still have the directory with the original compilation, check if PhreeqcRM.lib exists somewhere in the directory.
Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 4074
Re: PhreeqcRM: Testsuite Fail
« Reply #5 on: 21/07/20 21:58 »
For Windows the library will be PhreeqcRM.lib (or PhreeqcRMd.lib).

For Linux, the library will be named one of the following, possibly with a "d" before the dot indicating debug:

libphreeqcrm.a           (Static library)
libphreeqcrm.so          (Shared object library)
libphreeqcrm.la          (libtool library file)
Logged

kayakernate

  • Frequent Contributor
  • Posts: 11
Re: PhreeqcRM: Testsuite Fail
« Reply #6 on: 22/07/20 17:22 »
Looks like I haven't generated the PhreeqcRM.lib. Running "find * -name PhreeqcRM.lib" within my build returns nothing.

I am not using cmake to generate a makefile. I run the ../configure command in the parent directory, which produces my makefile for me. From there I just run make.

Would it be better to use cmake? I'm not sure where I'd find the CMakeLists file.
Logged

kayakernate

  • Frequent Contributor
  • Posts: 11
Re: PhreeqcRM: Testsuite Fail
« Reply #7 on: 22/07/20 17:34 »
PS I'm also unclear on what command I'd use the -DNO_UTF8_ENCODING -DUSE_OPENMP flags.
Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 4074
Re: PhreeqcRM: Testsuite Fail
« Reply #8 on: 22/07/20 17:43 »
I think the library would be the Linux name libphreeqcrm.a. Sorry, I added that in the next post.

Yes, try CMake.
Logged

kayakernate

  • Frequent Contributor
  • Posts: 11
Re: PhreeqcRM: Testsuite Fail
« Reply #9 on: 22/07/20 19:45 »
Found the libphreeqcrm.a file in my directory - Release_openmp/.libs/libphreeqcrm.a.

My cmake process - may have done this wrong:

1. Enter build directory.
Code: [Select]
cd Release_openmp2. Generate makefiles.
Code: [Select]
cmake .. 3. Build makefiles.
Code: [Select]
make .4. Error: can no longer find the omp.h file. I had libomp installed beforehand using brew, so I don't understand why this would happen now. I also still get the illegal character encoding errors.

Code: [Select]
[  1%] Building CXX object CMakeFiles/PhreeqcRM.dir/src/PhreeqcRM.cpp.o
/Users/nat.mal/VTK-Projects/ERT_Model/phreeqcrm-3.6.2-15100/src/PhreeqcRM.cpp:48:10: fatal error: 'omp.h' file not found
#include <omp.h>
         ^~~~~~~
1 error generated.
make[2]: *** [CMakeFiles/PhreeqcRM.dir/src/PhreeqcRM.cpp.o] Error 1
make[1]: *** [CMakeFiles/PhreeqcRM.dir/all] Error 2
make: *** [all] Error 2

PS If it helps clarify here's a rough description of what my directory lookout looks like:

phreeqcrm-3.6.2-15100/ #Contents within original tar file
------CMakeLists.txt
------src
------Release_openmp/ # Where I'm trying to build PhreeqcRM
------------MakeFile
------------Tests

Logged

charlton

  • Top Contributor
  • Posts: 49
Re: PhreeqcRM: Testsuite Fail
« Reply #10 on: 22/07/20 21:16 »
Hello Nathan,

Could you please upload the config.log file that is created when you run ../configure?

Thanks,
Scott
Logged

kayakernate

  • Frequent Contributor
  • Posts: 11
Re: PhreeqcRM: Testsuite Fail
« Reply #11 on: 23/07/20 05:48 »
Hey Scott,

Sure thing!

Places that particularly look weird to me include (but are not limited to):

 * lines 532-535 (choke),

 * 572-573 (clang unsupported option '-fopenmp),

 * 607 (clang: error: language not recognized: 'openmp'),

 * 641-647 (more choke),

 * 682 (clang: error: unknown argument: '-mp'),

 * 716-720 (even more choke),

 * line 757 - clang: error: unknown argument "-qsmp=omp"),

 * line 825

Overall, my impression is I'm missing a bunch of things. But the only problem is, I don't know what I'm missing :). I suspect maybe I don't have the right version of OpenMP - all I did was install libomp using brew. I am somewhat aware that clang doesn't really support it, so I am not sure if I need a different C++ compiler or not (which seems extreme to me).

I have no idea what choke is.

Any light you can shed on this is greatly appreciated.

« Last Edit: 23/07/20 05:53 by kayakernate »
Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 4074
Re: PhreeqcRM: Testsuite Fail
« Reply #12 on: 23/07/20 05:59 »
You should use the "Attachments and other options" to post the entire file.
Logged

charlton

  • Top Contributor
  • Posts: 49
Re: PhreeqcRM: Testsuite Fail
« Reply #13 on: 23/07/20 06:05 »
Hey David,

Are on here all the time?  I was just looking for the attachment myself.  Wasn't sure if I was doing something wrong.  I had problems seeing attachments the last time.

Scott

Logged

kayakernate

  • Frequent Contributor
  • Posts: 11
Re: PhreeqcRM: Testsuite Fail
« Reply #14 on: 23/07/20 06:39 »
My bad! It didn't post.

Here is the config.log file:

Logged

charlton

  • Top Contributor
  • Posts: 49
Re: PhreeqcRM: Testsuite Fail
« Reply #15 on: 23/07/20 21:35 »
Hi Nathan,

After installing Catalina and brew I was able to reproduce your problem.  I'm not that familiar with MacOS, but it seems to be problem with finding the omp shared library:

/usr/local/opt/libomp/lib/libomp.dylib

I tried setting various *LD_LIBRARY_PATHS but it seems that setting these environmental variables are considered a security risk on Catalina.

After some internet searches I found this:

https://cliutils.gitlab.io/modern-cmake/chapters/packages/OpenMP.html

And I was able to modify the top-level CMakeLists.txt file to make it work.

I unfortunately started posting this message from my pc, so I'll post what needs to be done in my next post from a mac.

Thanks,
Scott
Logged

charlton

  • Top Contributor
  • Posts: 49
Re: PhreeqcRM: Testsuite Fail
« Reply #16 on: 23/07/20 22:14 »
Hi Nathan,

Replace the top-level CMakeLists.txt file with the one I have attached. Then run the following commands from terminal.

$ cd phreeqcrm-3.6.2-15100
$ mkdir _cmake
$ cd _cmake
$ cmake ..
$ make -j 8  # you can ignore the ranlib warnings about no symbols
$ make test
 
and hopefully you'll get 100% tests passed.

For anyone else looking for all the steps to get this working on macOS Catalina 10.15.6, here are all the steps:

0. After updating to Catalina, I had to reinstall 'command line tools' using :
$ xcode-select --install

1. Install homebrew (there should be many online guides on how to do this). I used:
$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

2. Install the openmp library using brew:
$ brew install libomp

3. Install cmake using brew:
$ brew install cmake

4. Download the CMakeLists.txt attached to this post and replace the top-level CMakeLists.txt with it:
$ cd phreeqcrm-3.6.2-15100
$ cp ~/Downloads/CMakeLists.txt .

5. Run cmake:
$ mkdir _cmake
$ cd _cmake
$ cmake ..
$ make -j 8
$ make test


For reference here are all the versions I used:
$ gcc --version
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 11.0.3 (clang-1103.0.32.62)
Target: x86_64-apple-darwin19.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

$ cmake --version
cmake version 3.18.0

CMake suite maintained and supported by Kitware (kitware.com/cmake).

$ brew --version
Homebrew 2.4.8
Homebrew/homebrew-core (git revision 1bb848; last commit 2020-07-23)

$ brew info libomp
libomp: stable 10.0.0 (bottled)
LLVM's OpenMP runtime library
https://openmp.llvm.org/
/usr/local/Cellar/libomp/10.0.0 (9 files, 1.3MB) *
  Poured from bottle on 2020-07-23 at 01:52:21
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/libomp.rb
License: MIT
==> Dependencies
Build: cmake ✔
==> Analytics
install: 57,809 (30 days), 172,248 (90 days), 753,778 (365 days)
install-on-request: 7,001 (30 days), 22,159 (90 days), 85,730 (365 days)
build-error: 0 (30 days)

Let me know if you have any problems.

Thanks,
Scott
Logged

kayakernate

  • Frequent Contributor
  • Posts: 11
Re: PhreeqcRM: Testsuite Fail
« Reply #17 on: 26/07/20 15:47 »
Wow! It worked! Thank you so much!
Logged

  • Print
Pages: [1]   Go Up
« previous next »
  • PhreeqcUsers Discussion Forum »
  • Beginners »
  • Installation questions »
  • PhreeqcRM: Testsuite Fail
 

  • SMF 2.0.19 | SMF © 2021, Simple Machines | Terms and Policies
  • XHTML
  • RSS
  • WAP2