blend2d / blend2d

2D Vector Graphics Engine Powered by a JIT Compiler

Home Page:https://blend2d.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Have problems building the library

rempas opened this issue · comments

commented

I'm under Arch Linux (btw) and I have downloaded the source code from the download page.

When I'm trying to run cmake using the following configuration: cmake .. -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX=/home/rempas/.local \

I do get the following error:

** AsmJit Summary **
   ASMJIT_DIR=/home/rempas/Projects/Programming/blend2d/3rdparty/asmjit
   ASMJIT_TEST=FALSE
   ASMJIT_TARGET_TYPE=EMBED
   ASMJIT_DEPS=pthread;rt
   ASMJIT_LIBS=pthread;rt
   ASMJIT_CFLAGS=-DASMJIT_STATIC;-DASMJIT_NO_FOREIGN
   ASMJIT_PRIVATE_CFLAGS=-DASMJIT_STATIC;-DASMJIT_NO_FOREIGN
   ASMJIT_PRIVATE_CFLAGS_DBG=
   ASMJIT_PRIVATE_CFLAGS_REL=
** Blend2D Summary **
   BLEND2D_DIR=/home/rempas/Projects/Programming/blend2d
   BLEND2D_TEST=FALSE
   BLEND2D_TARGET_TYPE=SHARED
   BLEND2D_DEPS=c;m;pthread;rt
   BLEND2D_LIBS=blend2d;c;m;pthread;rt
   BLEND2D_CFLAGS=
   BLEND2D_PRIVATE_CFLAGS=-msse2;-DBL_BUILD_OPT_AVX2;-DASMJIT_STATIC;-DASMJIT_NO_FOREIGN;-DASMJIT_NO_STDCXX
   BLEND2D_PRIVATE_CFLAGS_DBG=
   BLEND2D_PRIVATE_CFLAGS_REL=
CMake Error at CMakeLists.txt:153 (target_compile_features):
  target_compile_features no known features for CXX compiler

  ""

  version .
Call Stack (most recent call first):
  CMakeLists.txt:791 (blend2d_add_target)


-- Configuring incomplete, errors occurred!

Should I try with the "git" version?

You can try git master, but I don't think it would be any different.

This log is btw not sufficient to diagnose the error - full log would be nice (without cmake cache) and the C++ compiler you are using as well (and target architecture).

commented

You can try git master, but I don't think it would be any different.

This log is btw not sufficient to diagnose the error - full log would be nice (without cmake cache) and the C++ compiler you are using as well (and target architecture).

Alright! I'm a n00b with CMake (have never personally use it), could you help me a little bit about how to get the information you need? I was not able to find the log. For the C++ compiler, I haven't chooses anything specific. If CMake uses the "c++" link, it is linked to GCC in my system. But Clang is installed as well so I don't know if it prioritizes that instead.

Which commands to execute starting from the "build" directory (or from Blend2d's source if you prefer, just let me know)?

I would just delete the build directory completely and use:

cd tools
./configure-makefiles.sh

and then print the output here.

Also cmake --version would be great, but it should be >= 3.8 already if it passes the version check.

Cmake should detect the compiler and print things it detects, that would definitely help.

commented

The output of cmake --version: cmake version 3.26.4

I hope you mean the output of ./configure-makefile.sh because, oh boy, it's big! Here it is:

== [Configuring Build - Debug] ==
-- The C compiler identification is GNU 13.1.1
-- The CXX compiler identification is GNU 13.1.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test __CxxFlag__fno_enforce_eh_specs
-- Performing Test __CxxFlag__fno_enforce_eh_specs - Success
-- Performing Test __CxxFlag__fno_threadsafe_statics
-- Performing Test __CxxFlag__fno_threadsafe_statics - Success
-- Performing Test __CxxFlag__fno_semantic_interposition
-- Performing Test __CxxFlag__fno_semantic_interposition - Success
-- Performing Test __CxxFlag__fmerge_all_constants
-- Performing Test __CxxFlag__fmerge_all_constants - Success
-- Performing Test __CxxFlag__ftree_vectorize
-- Performing Test __CxxFlag__ftree_vectorize - Success
-- Enabling build without linking to the C++ standard library
-- Performing Test __CxxFlag__mavx
-- Performing Test __CxxFlag__mavx - Success
-- Performing Test __CxxFlag__mavx2
-- Performing Test __CxxFlag__mavx2 - Success
** AsmJit Summary **
   ASMJIT_DIR=/home/rempas/Projects/Programming/blend2d/3rdparty/asmjit
   ASMJIT_TEST=FALSE
   ASMJIT_TARGET_TYPE=EMBED
   ASMJIT_DEPS=pthread;rt
   ASMJIT_LIBS=pthread;rt
   ASMJIT_CFLAGS=-DASMJIT_STATIC;-DASMJIT_NO_FOREIGN
   ASMJIT_PRIVATE_CFLAGS=-Wall;-Wextra;-Wconversion;-fno-math-errno;-fno-threadsafe-statics;-fno-semantic-interposition;-DASMJIT_STATIC;-DASMJIT_NO_FOREIGN
   ASMJIT_PRIVATE_CFLAGS_DBG=
   ASMJIT_PRIVATE_CFLAGS_REL=-O2;-fmerge-all-constants;-fno-enforce-eh-specs
** Blend2D Summary **
   BLEND2D_DIR=/home/rempas/Projects/Programming/blend2d
   BLEND2D_TEST=1
   BLEND2D_TARGET_TYPE=SHARED
   BLEND2D_DEPS=c;m;pthread;rt
   BLEND2D_LIBS=blend2d;c;m;pthread;rt
   BLEND2D_CFLAGS=
   BLEND2D_PRIVATE_CFLAGS=-Wall;-Wextra;-fno-exceptions;-fno-rtti;-fno-math-errno;-fno-trapping-math;-fno-finite-math-only;-fno-threadsafe-statics;-fno-semantic-interposition;-msse2;-DBL_BUILD_OPT_AVX2;-DASMJIT_STATIC;-DASMJIT_NO_FOREIGN;-DASMJIT_NO_STDCXX
   BLEND2D_PRIVATE_CFLAGS_DBG=
   BLEND2D_PRIVATE_CFLAGS_REL=-O2;-fno-enforce-eh-specs;-fmerge-all-constants;-ftree-vectorize
-- Configuring done (1.7s)
-- Generating done (0.1s)
-- Build files have been written to: /home/rempas/Projects/Programming/blend2d/build/Debug

== [Configuring Build - Release] ==
-- The C compiler identification is GNU 13.1.1
-- The CXX compiler identification is GNU 13.1.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test __CxxFlag__fno_enforce_eh_specs
-- Performing Test __CxxFlag__fno_enforce_eh_specs - Success
-- Performing Test __CxxFlag__fno_threadsafe_statics
-- Performing Test __CxxFlag__fno_threadsafe_statics - Success
-- Performing Test __CxxFlag__fno_semantic_interposition
-- Performing Test __CxxFlag__fno_semantic_interposition - Success
-- Performing Test __CxxFlag__fmerge_all_constants
-- Performing Test __CxxFlag__fmerge_all_constants - Success
-- Performing Test __CxxFlag__ftree_vectorize
-- Performing Test __CxxFlag__ftree_vectorize - Success
-- Enabling build without linking to the C++ standard library
-- Performing Test __CxxFlag__mavx
-- Performing Test __CxxFlag__mavx - Success
-- Performing Test __CxxFlag__mavx2
-- Performing Test __CxxFlag__mavx2 - Success
** AsmJit Summary **
   ASMJIT_DIR=/home/rempas/Projects/Programming/blend2d/3rdparty/asmjit
   ASMJIT_TEST=FALSE
   ASMJIT_TARGET_TYPE=EMBED
   ASMJIT_DEPS=pthread;rt
   ASMJIT_LIBS=pthread;rt
   ASMJIT_CFLAGS=-DASMJIT_STATIC;-DASMJIT_NO_FOREIGN
   ASMJIT_PRIVATE_CFLAGS=-Wall;-Wextra;-Wconversion;-fno-math-errno;-fno-threadsafe-statics;-fno-semantic-interposition;-DASMJIT_STATIC;-DASMJIT_NO_FOREIGN
   ASMJIT_PRIVATE_CFLAGS_DBG=
   ASMJIT_PRIVATE_CFLAGS_REL=-O2;-fmerge-all-constants;-fno-enforce-eh-specs
** Blend2D Summary **
   BLEND2D_DIR=/home/rempas/Projects/Programming/blend2d
   BLEND2D_TEST=1
   BLEND2D_TARGET_TYPE=SHARED
   BLEND2D_DEPS=c;m;pthread;rt
   BLEND2D_LIBS=blend2d;c;m;pthread;rt
   BLEND2D_CFLAGS=
   BLEND2D_PRIVATE_CFLAGS=-Wall;-Wextra;-fno-exceptions;-fno-rtti;-fno-math-errno;-fno-trapping-math;-fno-finite-math-only;-fno-threadsafe-statics;-fno-semantic-interposition;-msse2;-DBL_BUILD_OPT_AVX2;-DASMJIT_STATIC;-DASMJIT_NO_FOREIGN;-DASMJIT_NO_STDCXX
   BLEND2D_PRIVATE_CFLAGS_DBG=
   BLEND2D_PRIVATE_CFLAGS_REL=-O2;-fno-enforce-eh-specs;-fmerge-all-constants;-ftree-vectorize
-- Configuring done (1.7s)
-- Generating done (0.1s)
-- Build files have been written to: /home/rempas/Projects/Programming/blend2d/build/Release
commented

It is weird however that it says that it does the "debug" configuration in the beginning but in the end, it says that the files have been written to: /home/rempas/Projects/Programming/blend2d/build/Release. Check that "release" in the end. Weird...

It does two configurations - Debug and Release. Basically it's used mostly for development to configure the project quickly.

The output seems good, there are no errors, so I'm not really sure what was the problem initially. Does it build?

cd build/Release
make
commented

Sure! It compiles well! We're done with that, now what about the configuration options? I want to change the prefix specifically.

I just tried, and it works without a problem. Try something like this:

# in blend2d dir:
mkdir build_prefix
cd build_prefix
mkdir $HOME/your_install_target
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$HOME/your_install_target
make 
make install
commented

Haha, nope! It will not do me the favor! This is how I tried to do it in the beginning and got the error. Are you on Linux as well? Maybe a platform problem...

I would try to avoid the \ slashes initially. And yeah, I'm on Linux, and this is a pretty basic feature, so hard to tell why it doesn't work in your case

commented

I did avoid them. It seems to me that there is something going on with Cmake based on the error message. The worse thing is that it seems that you will probably not be able to help...

commented

Well, I'm gonna try the git version!

What is your cmake --version?

commented

3.26.4

But wait, there is more! So, I downloaded the git version and tried with it! Now, I do get a different problem error.

Have a look:

-- The C compiler identification is GNU 13.1.1
-- The CXX compiler identification is GNU 13.1.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test __CxxFlag__fno_enforce_eh_specs
-- Performing Test __CxxFlag__fno_enforce_eh_specs - Success
-- Performing Test __CxxFlag__fno_threadsafe_statics
-- Performing Test __CxxFlag__fno_threadsafe_statics - Success
-- Performing Test __CxxFlag__fno_semantic_interposition
-- Performing Test __CxxFlag__fno_semantic_interposition - Success
-- Performing Test __CxxFlag__fmerge_all_constants
-- Performing Test __CxxFlag__fmerge_all_constants - Success
-- Performing Test __CxxFlag__ftree_vectorize
-- Performing Test __CxxFlag__ftree_vectorize - Success
-- Enabling build without linking to the C++ standard library
-- Performing Test __CxxFlag__mavx
-- Performing Test __CxxFlag__mavx - Success
-- Performing Test __CxxFlag__mavx2
-- Performing Test __CxxFlag__mavx2 - Success
FATALUnable to find asmjit, please visit <https://blend2d.com/doc/build-instructions.html>
CMake Error at CMakeLists.txt:416 (include):
  include could not find requested file:

    /CMakeLists.txt


** Blend2D Summary **
   BLEND2D_DIR=/home/rempas/Projects/Programming/blend2d
   BLEND2D_TEST=FALSE
   BLEND2D_TARGET_TYPE=SHARED
   BLEND2D_DEPS=c;m;pthread;rt
   BLEND2D_LIBS=blend2d;c;m;pthread;rt
   BLEND2D_CFLAGS=
   BLEND2D_PRIVATE_CFLAGS=-Wall;-Wextra;-fno-exceptions;-fno-rtti;-fno-math-errno;-fno-trapping-math;-fno-finite-math-only;-fno-threadsafe-statics;-fno-semantic-interposition;-msse2;-DBL_BUILD_OPT_AVX2;-DASMJIT_NO_STDCXX
   BLEND2D_PRIVATE_CFLAGS_DBG=
   BLEND2D_PRIVATE_CFLAGS_REL=-O2;-fno-enforce-eh-specs;-fmerge-all-constants;-ftree-vectorize
-- Configuring incomplete, errors occurred!
commented

Does this say anything to you? I did used EXACTLY the Cmake comment you gave me. And, why does it have a different error message now? Aaaaah, so many questions....

commented

Wait a minute! If it searches for a file called "/CMakeLists.txt", then it is an absolute path! This may explain why it cannot find the file.

Further more, who chooses where the "CMakeLists.txt" is located? Is there an option to override its location?

Blend2D git repository doesn't bundle asmjit library, only releases do. For convenience, Blend2D would look in either parent directory or 3rdparty directory for asmjit - if it cannot find it, it would error.

BTW this is documented here in a section called "Building From Source":

commented

Oh!!! The version I downloaded had it inside "tools". That's why there is a different error message now, it makes absolute sense! If only I knew about that earlier, I just wasted your time over nothing...

But still, the version in the download page doesn't work so, I suppose a note would be nice so people don't waste your time for the same thing in the future.

So, I confirm that everything works! Thank you for your time and have a great day or night!

Glad it works, there will be a new version soon :)

commented

Nice! And thank you for having a C API, as I'm planning to create my own programming language and this will come in handy to create binding for it!