dkazanc / TomoPhantom

Software to generate 2D/3D/4D analytical phantoms and their Radon transforms (parallel beam) for image processing
https://dkazanc.github.io/TomoPhantom/
Apache License 2.0
116 stars 53 forks source link

Cmaking #33

Closed paskino closed 6 years ago

paskino commented 6 years ago

Work in progress to make the repository organised as CMake project.

closes #32

Still not finished!

dkazanc commented 6 years ago

@paskino thanks a lot for working on this. I have one branch where new modules have been added, shall I commit it to master so we can resolve some conflicts before merging?

paskino commented 6 years ago

This branch seems to work now. I shuffled stuff around, so I used Core instead of functions directory and so forth. Notice that I will remove the directories functions, python, matlab because I moved them.

You don't have to merge to master your branch, but you could add your changes to the new branch I create.

paskino commented 6 years ago

A simple CMake command that will work, suppose that build is a child of the repo dir :

mkdir build
cd build
cmake ../ -DBUILD_PYTHON_WRAPPER=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=./install
make install

the python bindings will be installed in ./install/python. To use it you need to set the LD_LIBRARY_PATH.

export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:./install/python/tomophantom

Then it'll work.

dkazanc commented 6 years ago

where ./install directory is actually created (python bindings )? Somehow I cannot find tomophantom after installation. Does this correct? export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:./install/python/tomophantom

paskino commented 6 years ago

It is a relative path, so it is a subdirectory (at least) of the build directory (the directory where you issue cmake the first time and then make.

In my example I created a build directory in the repository. From that directory I issued Cmake, so ./install is a subdirectory of build. To avoid confusion you can use absolute paths.

The LD_LIBRARY_PATH is another relative path. But it must point to the install/python or install/lib directory.

paskino commented 6 years ago

I suggest, when happy to merge to master. I'll take care of Matlab in another branch.

dkazanc commented 6 years ago

I'm working on restoring the demos to working order and commit soon.

paskino commented 6 years ago

Daniil, could you work in a branch of this? I'm doing a few things that might disrupt your changes.

Just git checkout -b restore_demos and then you can rebase or merge with cmaking

dkazanc commented 6 years ago

although I still have some issues with CMake I suggest we pull this one?

dkazanc commented 6 years ago

Although os.path.dirname thing didn't work, I'm committing anyway. Demos are in working order