animation_nodes icon indicating copy to clipboard operation
animation_nodes copied to clipboard

OpenBSD support

Open Veraellyunjie opened this issue 1 year ago • 4 comments

python3 setup.py build errors:

Run Cythonize
...
123/123:
Compiling /tmp/animation_nodes-OpenBSD-support/animation_nodes/utils/pointers.pyx because it changed.
[1/1] Cythonizing /tmp/animation_nodes-OpenBSD-support/animation_nodes/utils/pointers.pyx
egcc: fatal error: cannot execute 'cc1plus': execvp: No such file or directory
compilation terminated.
Compile FastNoiseSIMD
...
63/123:
running build_ext
building 'animation_nodes.libs.FastNoiseSIMD.wrapper' extension
creating build/temp.openbsd-7.1-amd64-3.9/tmp/animation_nodes-OpenBSD-support/animation_nodes/libs
creating build/temp.openbsd-7.1-amd64-3.9/tmp/animation_nodes-OpenBSD-support/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-OpenBSD-support/animation_nodes/libs/FastNoiseSIMD/source -I/usr/local/include/python3.9 -c /tmp/animation_nodes-OpenBSD-support/animation_nodes/libs/FastNoiseSIMD/wrapper.cpp -o build/temp.openbsd-7.1-amd64-3.9/tmp/animation_nodes-OpenBSD-support/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-OpenBSD-support/animation_nodes/libs/FastNoiseSIMD/wrapper.o -L/tmp/animation_nodes-OpenBSD-support/animation_nodes/libs/FastNoiseSIMD/source -L/usr/local/lib -lFastNoiseSIMD_openbsd -o /tmp/animation_nodes-OpenBSD-support/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

cc1plus is absent on my OpenBSD machine, even with find / -name cc1plus

OpenBSD itself doesn't use gcc relying on clang instead. It might be more appropriate to compile AN with clang for OpenBSD. gcc and clang arguments are incompatible, though.

resolve #1878

Veraellyunjie avatar Sep 17 '22 19:09 Veraellyunjie

Does compiling with CC=egcc CXX=eg++ or better yet CC=clang CXX=clang++ work?

OmarEmaraDev avatar Sep 17 '22 21:09 OmarEmaraDev

Please pardon my ignorance, but where exactly am I supposed to put CC=egcc CXX=eg++ or better yet CC=clang CXX=clang++?

These look to me like shell variables assignments; the only shell files in the original repo are compile_linux.sh and compile_macos.sh; both don't use variables.

The snippets don't look like python at all.

I tried grep -Recursively the repo for hints - fruitlessly.

If I need to read some docs to fill the gap in my knowledge please give me the link(s)

Veraellyunjie avatar Sep 21 '22 16:09 Veraellyunjie

Sorry, I just meant to execute the build script in that environment, that is, using the command:

CC=clang CXX=clang++ python3 setup.py build

This is to try to use clang for compilation, since you seem to indicate it is a better option on that platform.

OmarEmaraDev avatar Sep 21 '22 17:09 OmarEmaraDev

Same issue although a bit different output.


CC=egcc CXX=eg++ python3 setup.py build:

123/123:
Compiling /tmp/animation_nodes-OpenBSD-support/animation_nodes/utils/pointers.pyx because it changed.
[1/1] Cythonizing /tmp/animation_nodes-OpenBSD-support/animation_nodes/utils/pointers.pyx
egcc: fatal error: cannot execute 'cc1plus': execvp: No such file or directory
compilation terminated.
63/123:
running build_ext
building 'animation_nodes.libs.FastNoiseSIMD.wrapper' extension
creating build/temp.openbsd-7.1-amd64-3.9/tmp/animation_nodes-OpenBSD-support/animation_nodes/libs
creating build/temp.openbsd-7.1-amd64-3.9/tmp/animation_nodes-OpenBSD-support/animation_nodes/libs/FastNoiseSIMD
egcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -O2 -pipe -g -fPIC -O2 -pipe -g -O2 -pipe -g -fPIC -I/tmp/animation_nodes-OpenBSD-support/animation_nodes/libs/FastNoiseSIMD/source -I/usr/local/include/python3.9 -c /tmp/animation_nodes-OpenBSD-support/animation_nodes/libs/FastNoiseSIMD/wrapper.cpp -o build/temp.openbsd-7.1-amd64-3.9/tmp/animation_nodes-OpenBSD-support/animation_nodes/libs/FastNoiseSIMD/wrapper.o -g0 -std=c++11
egcc: fatal error: cannot execute 'cc1plus': execvp: No such file or directory
compilation terminated.
error: command '/usr/local/bin/egcc' failed with exit code 1

CC=clang CXX=clang++ python3 setup.py build:

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

Veraellyunjie avatar Sep 22 '22 21:09 Veraellyunjie

But can you find the libFastNoiseSIMD_openbsd.a library file in the build directory?

OmarEmaraDev avatar Sep 27 '22 19:09 OmarEmaraDev

python3 setup.py build >> python3_setup.py_build.log 2>&1
find . -iname '*libFastNoiseSIMD_openbsd.a*'

nothing

Veraellyunjie avatar Sep 29 '22 15:09 Veraellyunjie

Can you attach the full log?

OmarEmaraDev avatar Sep 29 '22 16:09 OmarEmaraDev

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Oct 29 '22 20:10 stale[bot]

It turns out, for cc1plus I needed to install a separate package: pkg_add g++, even though g++ is not displayed as available on the website: https://openports.se/search.php?so=g%2B%2B

New error messages:

123/123:
Compiling /tmp/animation_nodes-OpenBSD-support/animation_nodes/utils/pointers.pyx because it changed.
[1/1] Cythonizing /tmp/animation_nodes-OpenBSD-support/animation_nodes/utils/pointers.pyx
/tmp//ccgzPVDb.s: Assembler messages:
/tmp//ccgzPVDb.s:78: Error: no such instruction: `pmulld %xmm0,%xmm5'
...

python3_setup.py_build.log

Veraellyunjie avatar Nov 04 '22 23:11 Veraellyunjie

Are you on ARM or X86? Does your CPU support SSEE 4.1?

OmarEmaraDev avatar Nov 05 '22 11:11 OmarEmaraDev

Are you on ARM or X86?

x86-64

Does your CPU support SSEE 4.1?

You must have meant SSE 4.1, right? Specs say it does support, lscpu does print sse4_1 among others.

CPU is i5-3320M, machine is ThinkPad T530

Veraellyunjie avatar Nov 05 '22 19:11 Veraellyunjie

Then it appears you just have an old assembler version that doesn't support those instructions? Can you try updating that? This is probably part of the binutils package.

OmarEmaraDev avatar Nov 05 '22 19:11 OmarEmaraDev

binutils package was not installed at all. My OpenBSD has been installed with compilators fileset (part of base system), providing:

So, in the absence of binutils, AN was running something of OpenBSD native. I am currently on OpenBSD snapshot from Nov 2, the compilators fileset is as fresh, although it doesn't mean each utility/library in the fileset is recent - it might be pretty old if there was no need to update it for OpenBSD per se.


Having installed binutils, those errors persist.


python3_setup.py_build.log


binutils package is of latest version 2.39 and contains the following GNU binary utilities:

  • addr2line - Converts addresses into filenames and line numbers.
  • ar - A utility for creating, modifying and extracting from archives.
  • c++filt - Filter to demangle encoded C++ symbols.
  • elfedit - Update ELF header and program property of ELF files.
  • nm - Lists symbols from object files.
  • objcopy - Copies and translates object files.
  • objdump - Displays information from object files.
  • ranlib - Generates an index to the contents of an archive.
  • readelf - Displays information from any ELF format object file.
  • size - Lists the section sizes of an object or archive file.
  • strings - Lists printable strings from files.
  • strip - Discards symbols.

Veraellyunjie avatar Nov 06 '22 02:11 Veraellyunjie

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Dec 21 '22 02:12 stale[bot]