realthunder / solvespace

Parametric 2d/3d CAD
http://solvespace.com/
GNU General Public License v3.0
15 stars 3 forks source link

How to install without "sudo"? #6

Closed ceremcem closed 2 years ago

ceremcem commented 2 years ago

I need to install Solvespace backend without sudo because I want to keep my wrapper script not requiring root privileges.

Former install instructions were:

asm3="/home/aea/fc-build/Release/Mod/asm3/freecad/asm3"
py_slvs_dir="$asm3/py3_slvs"

mkdir -p $py_slvs_dir
cp $asm3/slvs/build/src/swig/python/{slvs.py,_slvs.so} $py_slvs_dir
touch $py_slvs_dir/__init__.py

This still seems to work (as far as I could test) but I prefer using your Makefile. Setting a different install directory is possible:

mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=/home/aea/hello ..
make
make install

This creates a bunch of files in /home/aea/hello but the files are much more than former instructions and there is no directory generated named py_slvs (or py_slvs3), which made me confused even more.

So, how can I officially install solvespace without root privileges?

realthunder commented 2 years ago

This would install SolveSpace the GUI application. If you just want to make the Python binding of the solver, run this

mkdir build
cd build
cmakd -DENABLE_GUI=Off -DCMAKE_BUILD_TYPE=Release -DBUILD_PYTHON ..
make _slvs

Unfortunately, there is no make install for _slvs target. You'll have to manually copy slvs.py, _slvs.so, which is pretty much what you are doing right now.

BTW, why not use pip install py-slvs? This is the pip package that I maintained, which contains prebuilts for most platform.

ceremcem commented 2 years ago

Okay, I can keep using the manual approach, as it's approved by you.

why not use pip install py-slvs?

I don't quite remember. I made a quick search and I found your post that you announced the py-slvs package. I think I prepared my build mechanism before that, so, it might be some kind of historical reasons.