Getting error "libbrotli needed" when compiling woff2 - c++

I am trying to compile google/woff2 for 3 days but getting error "libbrotli needed". I was able compile brotli by running CMakeLists.txt in brotli folder and got .so files. I am beginner so I don't know to link both together. I want to compile and add brotli from CMakeLists.txt in woff2 folder or at least somehow compile linux build for woff2.
Thanks

It seems like you need to compile and install brotli on your machine before you can compile google/woff2. The installation process is actually copying the .so and header file to somewhere on your system path that CMake is able to find it.
For example, you can you use this command to install the library to "/home/myuser/installdir"
cmake --install . --prefix "/home/myuser/installdir"

Build woff2 with libbrotli included in the executable
woff2/README.md says:
git clone --recursive https://github.com/google/woff2.git && cd woff2/ && make clean all
I.e. the woff2 executable´s can be built and used in the woff2/ directory, or can be copied to any location.
cd new-Folder/
git clone --recursive
https://github.com/google/woff2.git
cd woff2/
make clean all ## brotli libs and woff2 are built ... together
## executable: {woff2_compress, woff2_decompress, woff2_info}
## compress example
./woff2_compress satluj.ttf
Processing satluj.ttf => satluj.woff2
Compressed 45526 to 21423.
P.S.: Many of the "Linux OS" have woff2 (and libbrotli) available as a package, name = woff2 or woff2-tools.

Related

Graph-tool: compile and connect to local CGAL library, in Linux? (no sudo)

[Ubuntu]
I have compiled CGAL locally:
/path/to/cgal/
/lib/
libCGAL_Core.so libCGAL_Core.so.13.0.2
libCGAL_ImageIO.so.13 libCGAL.so libCGAL.so.13.0.2
libCGAL_Core.so.13 libCGAL_ImageIO.so
libCGAL_ImageIO.so.13.0.2 libCGAL.so.13
/include/
/CGAL/
version.h compiler_config.h
And I have managed to satisfy all of the graph-tool requirements except cgal (at least all of the requirements checked up to cgal):
./configure --with-boost=/path/to/boost --with-cgal=/path/to/cgal
And I get all successes up and until I get the following error message:
checking for __gmpz_init in -lgmp... yes
checking for __gmpz_init in -lgmp... (cached) yes
checking whether CGAL is available in /path/to/cgal... no
configure: error: CGAL library not found.
// the harshest part is that it seems to be searching in the correct
// directory.
I have tried specifying different points in the cgal build directory. The cgal compilation command I used was (from build directory):
cmake path/to/cgal_src_dir -DCMAKE_BUILD_TYPE=Release;
Next, I tried adding includes:
./configure --with-boost=$boost --with-cgal=path/to/cgal CPPFLAGS="-I path/to/cgal/include -I $HOME/.local/include" LDFLAGS="-L path/to/cgal/lib -L $HOME/.local/lib -Wl,-rpath=$HOME/.local/lib"
I will admit that I don't understand the -Wl,-rpath= part, I copied that from the graph-tool installation guide. The .local/lib folder contains the files for the other components, such as gmp, expat, sparsehash, etc.
This is not exact answer but as asked by OP will help in finishing installation, so please don't vote blindly.
To create debian package of libcgal open your CMakeList.txt and at the end of file add:
#--------------------------------------------------------------------
# Create debian files
#--------------------------------------------------------------------
if (UNIX AND NOT APPLE)
SET(CPACK_GENERATOR "DEB")
SET(CPACK_PACKAGE_NAME "libcgal-all")
SET(CPACK_PACKAGE_VERSION "${CGAL_VERSION}")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "C++ library for computational geometry (development files)\n CGAL (Computational Geometry Algorithms Library) makes the most important of the solutions and methods developed in computational geometry available to users in industry and academia in a C++ library. The goal is to provide easy access to useful, reliable geometric algorithms.\n .\n This package contains the header files and static libraries for libCGAL.so, libCGAL_Core.so, and libCGAL_ImageIO.so. The header files and static libraries for libCGAL_Qt4.so can be found in the package libcgal-qt4-dev.")
SET(CPACK_PACKAGE_CONTACT "bordeo")
SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libboost-dev, libboost-thread-dev, libboost-system-dev, libboost-program-options-dev, libgmp10-dev, libmpfr-dev, zlib1g-dev")
SET(CPACK_DEBIAN_PACKAGE_REPLACES "libcgal10, libcgal-dev")
INCLUDE(CPack)
endif()
In case you don't have any dependency remove whole line of SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libcln6, libcln-dev, libreadline6, libreadline6-dev, flex, bison"), and change others as it seems fit.
Now go to the terminal and issue following commands in cgal directory
mkdir build
cd build
cmake-gui ..
# set CMAKE_INSTALL_PREFIX to `~/.local
cmake ..
make -j4
cpack ..
you will find your debian built. Extract or install the debian to ~/.local.
Once this is done go to graph tool directory and start the build like
./configure --prefix="/wherever" --with-boost=/path/to/boost --with-cgal=~/.local
make -j4
make install
Hope this will solve your problem.

Building CGAL correctly

I am building cgal with the following command:
git clone https://github.com/CGAL/cgal.git cgal;
cd cgal;
git checkout releases/CGAL-4.12-branch;
mkdir ../cgal_library;
cd ../cgal_library; cmake ../cgal -DCGAL_LIB=`pwd` -DCGAL_HEADER_ONLY=ON;
I then go into the cgal_library directory, and the only things present in the lib and include directories are:
include/
CGAL/version.h
// and there is no lib dir, no headers whatsoever
Next, I install without the -DCGAL_HEADER_ONLY=ON flag, and all I get is a couple of images, which I cannot get another library's configure script to recognize as a valid cgal library:
include/
CGAL/compiler_config.h version.h
lib/
libCGAL_Core.so libCGAL_Core.so.13.0.2 libCGAL_ImageIO.so.13
libCGAL.so libCGAL.so.13.0.2
libCGAL_Core.so.13 libCGAL_ImageIO.so
libCGAL_ImageIO.so.13.0.2 libCGAL.so.13
So all I get are these image files and core objects--very few in number. I read the documentation, and I gather that there should be something in the include folder, and that the lib folder should have things in it, other than a few small object files.
How should I be compiling CGAL?
You specify in the cmake options that you want CGAL in HEADER-ONLY, that is why you don't have any lib. In HEADER-ONLY, you don't have to build CGAL, jsute give the path to the CGAL root directory as CGAL_DIR when building your program. If you want to build CGAL and have libs, make -DCGAL_HEADER_ONLY=OFF.

Cannot build Soundpipe DSP library on Windows

I've found the lightweight DSP c library - Soundpipe.
I want to use some filters from it. I do not really need binary files, but the problem is that the repository doesn't have its main header file - soundpipe.h. As I understand, this is because the library uses specific modules ported from Csound and FAUST languages. Also the repository's readme doesn't have installation guide for Windows. It says:
By default, Soundpipe needs libsndfile, and a standard build
environment. Other modules that use other external libraries will need
to be explicitly compiled by modifying config.mk (note: but the Makefile's folder doesn't contain config.mk, there is only config.def.mk)
To compile:
make
sudo make install
Ok, I've downloaded and installed libsndfile.
Then I have tried to use MSVC's nmake - it doesn't work:
makefile(7) : fatal error U1036: syntax error : too many names to left of '='
Stop.
Here is the beginning of the makefile:
> .PHONY: all clean install docs bootstrap
>
> default: all
>
> VERSION = 1.5.0
>
> INTERMEDIATES_PREFIX ?= . PREFIX ?= /usr/local
> ...
After that I've downloaded MinGW, mingw32-make result:
config.mk: No such file or directory
mingw32-make: *** No rule to make target 'config.def.mk', needed by 'config.mk'. Stop.
Ok, when I try to run the configure command, it doesn't work on my Win7 x 64 (sh: ./configure: No such file or directory, etc...)
I have the paths in mt system path variable:
C:\MinGW\bin;C:\MinGW\msys\1.0\bin
Links that I've read:
How Do I Run ./configure with MinGW?
Getting mingw-get to install correctly - mingw/msys path missing plus more!
MinGW's configure doesn't work after reinstalling Git for Windows and GCC_TDM too (No idea how to run configure).
Any ideas how to build the library or at least find missing source files (or make through CSound, Faust, ...) ?
The Soundpipe build system is designed to be used with POSIX environments, of which there are a few to choose from on Windows.
I've been able to build Soundpipe using both MSYS2 and Windows Bash on Windows 10.

Build folder and makefile

The question comes from my puzzlement when compiling a makefile for Deep Learning framework Caffe on Ubuntu, but it relates, I believe, to a more general phenomenon of the nature of compiling a C++ makefile.
After "make all", the resulting files from the compilation were put in a hidden folder: .build_release, not in the respective folders where the cpp files are.
Then when I tried to run the following lines:
./data/mnist/get_mnist.sh
./examples/mnist/create_mnist.sh
I was getting an error that the system does not find the file:
./create_mnist.sh: 16: ./create_mnist.sh: build/examples/mnist/convert_mnist_data.bin: not found
But the file actually existed in the .build_release folder.
What happened and how to fix this problem?
The issue is not with make, you simply need to follow the instructions carefully. The BUILD_DIR is specified by Makefile.config. By default this folder is named build. Once you followed the compilation instructions:
cp Makefile.config.example Makefile.config
# Adjust Makefile.config (for example, if using Anaconda Python)
make all
make test
make runtest
Navigate to build:
cd build
./data/mnist/get_mnist.sh
./examples/mnist/create_mnist.sh

Building libcsv problems

I'm having some trouble building the csv library libcsv.
I'm using Windows XP, MinGW compiler and MSYS command shell.
It configures ok (./configure) but when I go to build it I get the below error. I realise it has to do with autoconf (it requires 2.65 or above) So what do I do here. Do I download autoconf and have it in a separate directory marked c:\autoconf and have an environmental variable pointing to it? Or,, does it go in the MSYS folder.
I have downloaded the binaries for autoconf and I just get a bunch of files. The binary files are in a SHARE folder and a 'bin' folder. Do I put their contents into the MsYS share and bin folders? Looking around the web I'm also seeing references to putting the autoconf binaries into my MinGW/bin folder. I'm really not sure what to do here?
Can anyone help? Thank you.
xxxx#XXXX-2FEF09FD39 ~
$ cd C:\libcsv-3.0.3
xxxx#XXXX-2FEF09FD39 /c/libcsv-3.0.3
$ make
CDPATH="${ZSH_VERSION+.}:" && cd . && /bin/sh /c/libcsv-3.0.3/missing --run autoconf
/bin/m4: unrecognized option `--gnu'
Try `/bin/m4 --help' for more information.
autom4te: /bin/m4 failed with exit status: 1
make: *** [configure] Error 1
xxxx#XXXX-2FEF09FD39 /c/libcsv-3.0.3
$