animation_nodes icon indicating copy to clipboard operation
animation_nodes copied to clipboard

Widen range of OS support - *BSD, Haiku etc.

Open Veraellyunjie opened this issue 3 years ago • 1 comments

Opening a new issue was suggested at https://github.com/JacquesLucke/animation_nodes/issues/1240#issuecomment-1239483711

Blender itself is available on more platforms than AN supports: FreeBSD: https://www.freshports.org/graphics/blender/ OpenBSD: https://openports.se/graphics/blender Haiku: https://depot.haiku-os.org/__multipage/pkg/blender3/haikuports/haikuports_x86_64/3/0/1/-/1/x86_64?natlangcode=en

Being on OpenBSD, I made a try to install AN and had no success. Pre-built release for Linux doesn't fit whereas in building it myself I got stuck with:

egcc: fatal error: cannot execute 'cc1plus': execvp: No such file or directory
compilation terminated.
building 'animation_nodes.libs.FastNoiseSIMD.wrapper' extension
creating build/temp.openbsd-7.1-amd64-3.9/tmp/animation_nodes-master
creating build/temp.openbsd-7.1-amd64-3.9/tmp/animation_nodes-master/animation_nodes
creating build/temp.openbsd-7.1-amd64-3.9/tmp/animation_nodes-master/animation_nodes/libs
creating build/temp.openbsd-7.1-amd64-3.9/tmp/animation_nodes-master/animation_nodes/libs/FastNoiseSIMD
cc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -O2 -pipe -g -fPIC -O2 -pipe -g -O2 -pipe -g -fPIC -I/tmp/animation_nodes-master/animation_nodes/libs/FastNoiseSIMD/source -I/usr/local/include/python3.9 -c /tmp/animation_nodes-master/animation_nodes/libs/FastNoiseSIMD/wrapper.cpp -o build/temp.openbsd-7.1-amd64-3.9/tmp/animation_nodes-master/animation_nodes/libs/FastNoiseSIMD/wrapper.o -g0 -std=c++11
c++ -pthread -shared -fPIC -L/usr/local/lib/ build/temp.openbsd-7.1-amd64-3.9/tmp/animation_nodes-master/animation_nodes/libs/FastNoiseSIMD/wrapper.o -L/tmp/animation_nodes-master/animation_nodes/libs/FastNoiseSIMD/source -L/usr/local/lib -lFastNoiseSIMD_openbsd -o /tmp/animation_nodes-master/animation_nodes/libs/FastNoiseSIMD/wrapper.cpython-39.so
ld: error: unable to find library -lFastNoiseSIMD_openbsd
c++: error: linker command failed with exit code 1 (use -v to see invocation)
error: command '/usr/bin/c++' failed with exit code 1

find / -name cc1plus returns nothing. I'm not actually knowledgeable in the topic.

My trivial edits:

diff -r animation_nodes-master/_setuputils/generic.py animation_nodes-master.openbsd/_setuputils/generic.py
14a15
> onOpenBSD = sys.platform.startswith("openbsd")
16c17
< if not (onLinux or onWindows or onMacOS):
---
> if not (onLinux or onWindows or onMacOS or onOpenBSD):
diff -r animation_nodes-master/_setuputils/compilation.py animation_nodes-master.openbsd/_setuputils/compilation.py
124c124
<         if onLinux or onMacOS:
---
>         if onLinux or onMacOS or onOpenBSD:
diff -r animation_nodes-master/setup.py animation_nodes-master.openbsd/setup.py
37a38
> elif onOpenBSD: currentOS = "openbsd"
diff -r animation_nodes-master/animation_nodes/libs/FastNoiseSIMD/wrapper_setup_info.py animation_nodes-master.openbsd/animation_nodes/libs/FastNoiseSIMD/wrapper_setup_info.py
40a41,44
>     if utils.onOpenBSD:
>         return ("libFastNoiseSIMD_openbsd.a",
>                 ["sh", os.path.join(sourceDir, "compile_openbsd.sh")],
>                 {"libraries" : ["FastNoiseSIMD_openbsd"]})
cat animation_nodes-master.openbsd/animation_nodes/libs/FastNoiseSIMD/source/compile_openbsd.sh
#!/bin/sh

# copied from file compile_macos.sh
# on OpenBSD gcc installs as /usr/local/bin/egcc

set -e

egcc -c FastNoiseSIMD.cpp -std=c++11 -fPIC -O3
egcc -c FastNoiseSIMD_internal.cpp -std=c++11 -fPIC -O3

if [ "$(arch)" == "arm64" ]; then
	egcc -c FastNoiseSIMD_neon.cpp -std=c++11 -fPIC -O3
else
	egcc -c FastNoiseSIMD_sse2.cpp -std=c++11 -fPIC -O3 -msse2
	egcc -c FastNoiseSIMD_sse41.cpp -std=c++11 -fPIC -O3 -msse4.1
	egcc -c FastNoiseSIMD_avx2.cpp -std=c++11 -fPIC -O3 -march=core-avx2
fi

egcc-ar rcs libFastNoiseSIMD_openbsd.a *.o

echo "Done."

Veraellyunjie avatar Sep 08 '22 20:09 Veraellyunjie

Can you move those edits into a pull request to better see the changes and identify what we need to do further?

OmarEmaraDev avatar Sep 16 '22 18:09 OmarEmaraDev

Since there is already a pull request for this, lets continue the discussion and reopen there if needed.

OmarEmaraDev avatar Feb 24 '23 12:02 OmarEmaraDev