dafer45 / TBTK

A C++ library for solving second-quantized Hamiltonians
http://second-tech.com/wordpress/index.php/tbtk/
Apache License 2.0
101 stars 24 forks source link

Unable to locate "TBTK/Statistics.h" in Serializable.h #16

Open ash-007-m opened 2 days ago

dafer45 commented 2 days ago

Please provide steps to reproduce the error.

ash-007-m commented 2 days ago

when i am trying to run a file by including #TBTK/Statistics.h then g++ is unable to locate it , further I searched Utilities and TBTK folder and there is no such file

dafer45 commented 2 days ago

The file is in Lib/include/Core/TBTK/Statistics.h. I don't know what you are doing, but it seems to me that you are trying to use the library without first compiling and installing it. My recommendation is to use the VS code dev-container that you can clone from here https://github.com/dafer45/TBTKDevContainer. It will handle all the installation for you.

If you are unable to use the dev-container and need to do a custom installation, make sure you follow the instructions here https://www.second-quantization.com/InstallationInstructions.html?

Please give me more details of how you are trying to use it if you still can't get it to work. Are you for example trying to copy the source tree into your own project?

ash-007-m commented 2 days ago

I have done custom installation since i don't have "sudo" access , the problem is just my g++ compiler is giving fatal error, it may be because of environement variable. do i need to added these path separately

dafer45 commented 2 days ago

Alright, assuming you install it under /home/username/usr/, you should add the following to your .bash_profile

if [ -z "${PATH}" ]; then
    export PATH=/home/username/usr/bin
else
    export PATH=$PATH:/home/username/usr/bin
fi
if [ -z "${CPLUS_INCLUDE_PATH}" ]; then
    export CPLUS_INCLUDE_PATH=/home/username/usr/include
else
    export CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH:/home/username/usr/include
fi
if [ -z "${LIBRARY_PATH}" ]; then
    export LIBRARY_PATH=/home/username/usr/lib
else
    export LIBRARY_PATH=$LIBRARY_PATH:/home/username/usr/lib
fi

Replace /home/username/usr with whatever path you actually specified with the -DCMAKE_INSTALL_PREFIX flag.

You will need to restart the shell for these changes to take effect.