rjhogan / Adept-2

Combined array and automatic differentiation library in C++
http://www.met.reading.ac.uk/clouds/adept/
Apache License 2.0
163 stars 29 forks source link

build in separate directory fails #30

Open bradbell opened 1 year ago

bradbell commented 1 year ago

Steps to reproduce:

  1. git clone https://github.com/rjhogan/Adept-2 adept.git
  2. cd adpet.git
  3. autoreconf
  4. mkdir build
  5. cd build
  6. ../configure
  7. make

Result:

...
Making all in test
/bin/sh: line 21: cd: test: No such file or directory
make[1]: *** [Makefile:503: all-recursive] Error 1
make[1]: Leaving directory '/home/bradbell/repo/cmpad.git/external/adept.git/build'
make: *** [Makefile:383: all] Error 2

Configure Warning: configure: WARNING: cannot determine how to obtain linking information from f77

System:

build>uname -a
Linux brad-mobile 6.4.12-200.fc38.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Aug 23 17:46:49 UTC 2023 x86_64 GNU/Linux
rjhogan commented 1 year ago

Hi, I've not tested it in a separate build directory - the instructions say to type ./configure and make in the top-level directory.

bradbell commented 1 year ago

Hi, I've not tested it in a separate build directory - the instructions say to type ./configure and make in the top-level directory.

OK that works.

bradbell commented 1 year ago

Is there a proper way to create a debug / release version of the libraries ?

rjhogan commented 1 year ago

Most of the Adept library is in headers, so if you want to debug your own code that use the library, you don't need to recompile the Adept library - you just should compile your code with the -DADEPT_BOUNDS_CHECKING -DADEPT_INIT_SNAN -DADEPT_TRACK_NON_FINITE_GRADIENTS flags (although I normally don't bother with the last one).

See the other options at section 5.6.1 at http://www.met.reading.ac.uk/clouds/adept/adept_documentation_2.1.pdf

bradbell commented 1 year ago

I was able to implement a general adapet gradient and thereby include adept in my new AD comparison package; see https://cmpad.readthedocs.io/en/latest/adept_gradient.hpp.html

The idea behind this comparison package is that it should be easy to add packages and easy to build and test for just one package; i.e., it is only necessary to get the packages one is interested in.

The result for some small example cases can be seen in src/main.csv: https://cmpad.readthedocs.io/en/latest/xam_main.py.html#src-xam-main-csv

The cases above are small. You can run larger cases (on your system) using the program https://cmpad.readthedocs.io/en/latest/main.html

Thanks.