[aspect-devel] help with compiling plugin

Magali Billen mibillen at ucdavis.edu
Thu Aug 4 11:24:45 PDT 2016


Hello,

I am working on making a modified version of the material-module steinberger.cc <http://steinberger.cc/>.
I have turned this into a different material module with a new name and am keeping it in a separate “Aspect-MyModules” directory,
so I can compile separately following the instructions in the manual.  My new module is called material_lookup_compressible

I followed the instructions in the manual:
(First I ran open /Applications/deal.II.app so I am doing all this from the deal-II terminal window)

put material_module_incompressible.h and material_module_incompressible.cc files into /Users/Billen/Research/Aspect-MyModules
In material_module_incompressible.cc change #include line to refer to material_module_incompressible.h in the current directory:

#include “material_module_incompressible.h"

Modify CMakeLists.txt to list *.cc files in the ADD_LIBRARY line
ADD_LIBRARY(${TARGET} SHARED material_module_incompressible.cc)

Then run CMAKE with direct link to the ASPECT directory

bash-3.2$ sudo /Applications/CMake.app/Contents/bin/cmake -D Aspect_DIR=$HOME/Research/Src/aspect/build_deal.ii.app/ .

Then run make

bash-3.2$ sudo make


I get the following output from the cmake and make commands:

bash-3.2$ sudo /Applications/CMake.app/Contents/bin/cmake -D Aspect_DIR=$HOME/Research/Src/aspect/build_deal.ii.app/ .
Password:
-- Setting up plugin:
--   name <Billen-Plugins>
--   using ASPECT_DIR 
--   in Release mode
-- Configuring done
CMake Warning (dev):
  Policy CMP0042 is not set: MACOSX_RPATH is enabled by default.  Run "cmake
  --help-policy CMP0042" for policy details.  Use the cmake_policy command to
  set the policy and suppress this warning.

  MACOSX_RPATH is not specified for the following targets:

   Billen-Plugins

This warning is for project developers.  Use -Wno-dev to suppress it.

-- Generating done
-- Build files have been written to: /Users/billen/Research/Aspect-MyModules
bash-3.2$ sudo make
Scanning dependencies of target Billen-Plugins
[ 33%] Building CXX object CMakeFiles/Billen-Plugins.dir/material_lookup_compressible.cc.o
In file included from /Users/billen/Research/Aspect-MyModules/material_lookup_compressible.cc:23:
/Users/billen/Research/Src/aspect/include/aspect/utilities.h:341:43: error: use of undeclared identifier 'ASPECT_SOURCE_DIR'
                                          ASPECT_SOURCE_DIR);
                                          ^
1 error generated.
make[2]: *** [CMakeFiles/Billen-Plugins.dir/material_lookup_compressible.cc.o] Error 1
make[1]: *** [CMakeFiles/Billen-Plugins.dir/all] Error 2
make: *** [all] Error 2



I looked in the utilities. <http://utilities.cc/>h file and the error above refers to these lines, but I don’t know why this is giving me this error:

    /**
     * Add standard call for replacing $ASPECT_SOURCE_DIR
     */
    inline
    std::string
    expand_ASPECT_SOURCE_DIR (std::string location)
    {
      return Utilities::replace_in_string(location,
                                          "$ASPECT_SOURCE_DIR",
                                          ASPECT_SOURCE_DIR);
    }


Before turning this into my own plug-in, I just made a modified steinberger.cc <http://steinberger.cc/> and steinberger.h file in the aspect source and include directories 
and compiled and ran, and that worked. So, this seems to be related to turning this into my own modules in a separate plug-in directory.

Any ideas on what to do?
Magali

-----------------------------------------------------------
Professor of Geophysics 
Chair, Geology Graduate Program
Earth & Planetary Sciences Dept., UC Davis
Davis, CA 95616
Room 2129 Earth & Physical Sciences Bldg.
Office Phone: (530) 752-4169
http://mygeologypage.ucdavis.edu/billen/
-----------------------------------------------------------

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.geodynamics.org/pipermail/aspect-devel/attachments/20160804/f90243a8/attachment.html>


More information about the Aspect-devel mailing list