Code Monkey home page Code Monkey logo

helfem's People

Contributors

mortenpi avatar susilehtola avatar yurivict avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

helfem's Issues

Build fails with BUILD_SHARED_LIBS=ON

/usr/local/bin/ld: CMakeFiles/helfem-common.dir/general/checkpoint.cpp.o: in function `tempname()':
checkpoint.cpp:(.text+0x7680): warning: warning: tempnam() possibly used unsafely; consider using mkstemp()
/usr/local/bin/ld: ../libhelfem/libhelfem.a(grid.cpp.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/local/bin/ld: ../libhelfem/libhelfem.a(chebyshev.cpp.o): relocation R_X86_64_32S against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/local/bin/ld: ../libhelfem/libhelfem.a(lobatto.cpp.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/local/bin/ld: ../libhelfem/libhelfem.a(utils.cpp.o): relocation R_X86_64_32S against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/local/bin/ld: ../libhelfem/libhelfem.a(polynomial.cpp.o): relocation R_X86_64_32S against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/local/bin/ld: ../libhelfem/libhelfem.a(polynomial_basis.cpp.o): relocation R_X86_64_32S against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/local/bin/ld: ../libhelfem/libhelfem.a(ModelPotential.cpp.o): relocation R_X86_64_32S against symbol `_ZTVN6helfem14modelpotential14ModelPotentialE' can not be used when making a shared object; recompile with -fPIC
/usr/local/bin/ld: ../libhelfem/libhelfem.a(GaussianNucleus.cpp.o): relocation R_X86_64_32S against symbol `_ZTVN6helfem14modelpotential15GaussianNucleusE' can not be used when making a shared object; recompile with -fPIC
/usr/local/bin/ld: ../libhelfem/libhelfem.a(HollowNucleus.cpp.o): relocation R_X86_64_32S against symbol `_ZTVN6helfem14modelpotential13HollowNucleusE' can not be used when making a shared object; recompile with -fPIC
/usr/local/bin/ld: ../libhelfem/libhelfem.a(PointNucleus.cpp.o): relocation R_X86_64_32S against symbol `_ZTVN6helfem14modelpotential12PointNucleusE' can not be used when making a shared object; recompile with -fPIC
/usr/local/bin/ld: ../libhelfem/libhelfem.a(SphericalNucleus.cpp.o): relocation R_X86_64_32S against symbol `_ZTVN6helfem14modelpotential16SphericalNucleusE' can not be used when making a shared object; recompile with -fPIC
/usr/local/bin/ld: ../libhelfem/libhelfem.a(RadialBasis.cpp.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/local/bin/ld: ../libhelfem/libhelfem.a(helfem.cpp.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/local/bin/ld: ../libhelfem/libhelfem.a(quadrature.cpp.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/local/bin/ld: ../libhelfem/libhelfem.a(RadialPotential.cpp.o): relocation R_X86_64_32S against symbol `_ZTVN6helfem14modelpotential15RadialPotentialE' can not be used when making a shared object; recompile with -fPIC
/usr/local/bin/ld: ../libhelfem/libhelfem.a(erfc_expn.cpp.o): relocation R_X86_64_32S against `.rodata.cst8' can not be used when making a shared object; recompile with -fPIC
/usr/local/bin/ld: final link failed: nonrepresentable section on output
c++: error: linker command failed with exit code 1 (use -v to see invocation)

BUILD_SHARED_LIBS is a standard way for users to control type of libraries that the project builds.

[BUG] Cannot run the GENSAP using the debug model

Dear all,
attributed to the the boundary check for Armadillo in the debug model, the complied HelFEM cannot take the calculation for gensap execute.
I have check the code, I found the there is a tiny bug in src/sadatom/dftgrid.cpp starting from line 442, where the col and row index of the some matrix (1xN size) should be exchanged, as

diff --git a/src/sadatom/dftgrid.cpp b/src/sadatom/dftgrid.cpp
index a37fcc3..2172b87 100644
--- a/src/sadatom/dftgrid.cpp
+++ b/src/sadatom/dftgrid.cpp
@@ -434,29 +434,29 @@ namespace helfem {
               vtaub = vtau(1,i);
             }
           } else {
-            rhoa = 0.5*rho(i,0);
-            rhob = 0.5*rho(i,0);
-            vrhoa = vxc(i,0);
-            vrhob = vxc(i,0);
+            rhoa = 0.5*rho(0,i);
+            rhob = 0.5*rho(0,i);
+            vrhoa = vxc(0,i);
+            vrhob = vxc(0,i);
             if(gga || mgga_t || mgga_l) {
-              sigmaaa = 0.25*sigma(i,0);
-              sigmaab = 0.25*sigma(i,0);
-              sigmabb = 0.25*sigma(i,0);
-              vsigmaaa = vsigma(i,0);
-              vsigmaab = vsigma(i,0);
-              vsigmabb = vsigma(i,0);
+              sigmaaa = 0.25*sigma(0,i);
+              sigmaab = 0.25*sigma(0,i);
+              sigmabb = 0.25*sigma(0,i);
+              vsigmaaa = vsigma(0,i);
+              vsigmaab = vsigma(0,i);
+              vsigmabb = vsigma(0,i);
             }
             if(mgga_l) {
-              lapla = 0.5*lapl(i,0);
-              laplb = 0.5*lapl(i,0);
-              vlapla = vlapl(i,0);
-              vlaplb = vlapl(i,0);
+              lapla = 0.5*lapl(0,i);
+              laplb = 0.5*lapl(0,i);
+              vlapla = vlapl(0,i);
+              vlaplb = vlapl(0,i);
             }
             if(mgga_t) {
-              taua = 0.5*tau(i,0);
-              taub = 0.5*tau(i,0);
-              vtaua = vtau(i,0);
-              vtaub = vtau(i,0);
+              taua = 0.5*tau(0,i);
+              taub = 0.5*tau(0,i);
+              vtaua = vtau(0,i);
+              vtaub = vtau(0,i);
             }
           }

Cheers,
kylin

Cant find <hdf5.h>

#include <hdf5.h>
| ^~~~~~~~
compilation terminated.
make[2]: *** [src/CMakeFiles/helfem-common.dir/build.make:244: src/CMakeFiles/helfem-common.dir/general/checkpoint.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:168: src/CMakeFiles/helfem-common.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

Before cmake would even work you need to add two lines to the ~/.bashrc file as follows

Cmake variables for CMakeLists.txt for use with fortran and gcc

export CC=/usr/bin/gcc
export FC=/usr/bin/gfortran

#set a path pointing to the header files
PATH=$PATH:/usr/include/hdf5/serial/

libhdf5-dev is installed

returned from issuing sudo apt install libhdf5-dev

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
libhdf5-dev is already the newest version (1.10.8+repack1-1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Executing cmake .. from subdirectory in HelFEM directory after git- clone was fine and reports all found as follows

-- The CXX compiler identification is GNU 12.2.0
-- The Fortran compiler identification is GNU 12.2.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Check for working Fortran compiler: /usr/bin/gfortran - skipped
-- Found OpenMP_CXX: -fopenmp (found version "4.5")
-- Found OpenMP_Fortran: -fopenmp (found version "4.5")
-- Found OpenMP: TRUE (found version "4.5")
-- Configuring done
-- Generating done
-- Build files have been written to: /home/mark/works/HelFEM/objdir

This built without errors

On issuing make from the build directory this then reports as above i.e cant find <hd5.h>

Ran your install script but this fails the same way

Also reported were these errors but nothing serious although could be corrected

[ 42%] Building CXX object libhelfem/CMakeFiles/helfem.dir/src/RadialBasis.cpp.o
cd /home/mark/works/HelFEM/objdir/libhelfem && /usr/bin/c++ -I/home/mark/works/HelFEM/libhelfem/include -I/home/mark/works/HelFEM/objdir/libhelfem -g -O2 -Wall -Wno-implicit-fallthrough -Wno-misleading-indentation -DARMA_NO_DEBUG -DARMA_DONT_USE_WRAPPER -fopenmp -O3 -DNDEBUG -std=gnu++11 -MD -MT libhelfem/CMakeFiles/helfem.dir/src/RadialBasis.cpp.o -MF CMakeFiles/helfem.dir/src/RadialBasis.cpp.o.d -o CMakeFiles/helfem.dir/src/RadialBasis.cpp.o -c /home/mark/works/HelFEM/libhelfem/src/RadialBasis.cpp
/home/mark/works/HelFEM/libhelfem/src/RegularizedNucleus.cpp:85:19: warning: ‘double helfem::modelpotential::h_normalization(int)’ defined but not used [-Wunused-function]
85 | static double h_normalization(int N) {
| ^~~~~~~~~~~~~~~
/home/mark/works/HelFEM/libhelfem/src/RegularizedNucleus.cpp:28:19: warning: ‘double helfem::modelpotential::normalization_slice(int, std::function<double(double)>&)’ defined but not used [-Wunused-function]
28 | static double normalization_slice(int N, std::function<double(double)> & phif) {
| ^~~~~~~~~~~~~~~~~~~

hdf5-dev is installed but not finding the header files for some reason so I think must be issue with the MakeLists.txt file

this is after installing
libraries required

libarmadillo11 libarmadillo-dev libgsl-dev h5utils hdf5-filter-plugin hdf5-plugin-lzf hdf5-tools libhdf5-103-1 libhdf5-cpp-103 libhdf5-cpp-103-1 libhdf5-dev libhdf5-fortran-102 libhdf5-hl-fortran-100 libhdf5-hl-cpp-100 libhdf5-hl-100

os details
Distributor ID: Debian
Description: Debian GNU/Linux 12 (bookworm)
Release: 12
Codename: bookworm

Linux kernel version: 6.1.0-10-amd64

Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.2.0 (Debian 12.2.0-14)

Thanking you

Mark

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.