I have an upcoming Ada project (command-line interactive console program) and I would like to use something like ncurses to make screen management simpler.
I have installed the following packages (under Ubuntu 19.10 with latest updates):
GNAT 8.3.0
libncurses-dev
libncursesada-dev
libncursesada6.2.20180127
libncursesada6.2.20180127-dev
In the "....../libncursesada-doc/examples/" directory there are quite a few demo programs, attempting to build any of them causes complaints such as:
$ gnatmake rain
aarch64-linux-gnu-gcc-8 -c rain.adb
rain.adb:44:06: file "terminal_interface.ads" not found
rain.adb:44:06: "Rain (body)" depends on "Ncurses2.Util (spec)"
rain.adb:44:06: "Ncurses2.Util (spec)" depends on "Terminal_Interface (spec)"
rain.adb:47:06: file "terminal_interface.ads" not found
gnatmake: "rain.adb" compilation error
Does this missing file indicate that this set of packages is broken or have I simply missed one out somewhere?
Or to put it another way, am I barking up the wrong tree with ncurses? Is there a modern alternative that plays nicely with Ada?
This worked for me on Debian 10.
GNAT version:
$ gnat --version
GNAT 8.3.0
Copyright (C) 1996-2018, Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Install:
$ sudo apt-get install \
libncurses-dev \
libncursesada-doc \
libncursesada6.2.20180127 \
libncursesada6.2.20180127-dev
Create a new dir:
$ cd ~
$ mkdir rain
$ cd ~/rain
Now build. In this case, we need to provide references to the source dirs using -aI (see also here) and link with libncursesada using -largs -lncursesada (see also here):
$ gnatmake \
-aI/usr/share/doc/libncursesada-doc/examples \
-aI/usr/share/ada/adainclude/ncursesada \
rain.adb \
-largs -lncursesada
Related
I'm trying to compile FFMPEG with x265 on Win10. I am using the latest full MinGW build from xhmikosr found at:
http://xhmikosr.1f0.de/tools/msys/
FFMEPG without x265 compiles without problems and compiling x265 standalone works without problems too.
However when i --enable-libx265 in ffmpeg i get the following error:
ERROR: x265 not found using pkg-config
and this from the config.log:
require_pkg_config libx265 x265 x265.h x265_api_get
check_pkg_config libx265 x265 x265.h x265_api_get
test_pkg_config libx265 x265 x265.h x265_api_get
false --exists --print-errors x265
ERROR: x265 not found using pkg-config
my config paths seem to be all set correct.
$ echo $PKG_CONFIG_PATH
C:\MYSYS\local\x86_64-w64-mingw32\lib\pkgconfig
and when i look for the libraries x265 is there:
$ pkg-config --list-all
...
x265 x265 - H.265/HEVC video encoder
...
and here the debug log:
$ pkg-config --debug
...
File 'x265.pc' appears to be a .pc file
Will find package 'x265' in file 'C:/MYSYS/local/x86_64-w64-mingw32/lib/pkgconfig\x265.pc'
...
Why does pkg-config still not find the x265 libraries when i try to compile?
After much trial and error, I believe I have found a solution and the root cause under Ubuntu 16.04. This solution may work for other variants of Ubuntu as well.
If you run into the Package Config error described in this thread, try installing the default (repository based) libraries first, and then install your custom version with your ffmpeg build script.
Run these commands as needed prior to running your custom script to compile ffmpeg and your dependent libraries (e.g. x265) from source:
apt install -y libx265-dev
If another library fails, try the same technique and then run your script again to see if it works. For example, some people report compiling ffmpeg from source complains about gnutls. The solution for Ubuntu 16.04 is to first install it via apt and then run your script.
apt install -y gnutls-dev
If you're hung up at compiling the x264 libraries (for H.264 support), simply run this before running your script:
apt install -y libx264-dev
As long as your new script overwrites the old files and does not purge them, this method will work.
Background/History
The source of the problem dates back to at least 2017, and despite numerous claims it does not appear to have actually been fixed. One can find references in various forums and websites of frustrated users unable to get their compile to work correctly regardless of the version of the ffmpeg build, such as here.
It's a difficult problem to solve partly because the VLC Developer instructions for installing x265 library support are broken. Furthermore, the archive of information explaining this problem and how to solve it is no longer available, due to BitBucket's decision to sunset Mercurial support earlier this year. Most archived forum posts explaining the problem and how to solve it are gone. There are a few clues still to be found on GitHub, but they are incomplete snippets of information on the topic; none offer a complete perspective.
Installing ffmpeg from scratch is bound to cause headaches for nearly anyone. NONE of the scripts I found online (dozens) worked correctly as described. Most of the problems with them are incorrect/outdated links. Solutions with GitHub links appear to be the most consistently reliable. Others should be avoided (e.g. hg, which is no longer supported as mentioned above).
In my experience, I configure ffmpeg with x265 in CentOS, it also got error message as
ERROR: x265 not found using pkg-config
After I try this:
$ export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig"
I configure and compile ffmpeg successfully with x265. You can try this.
x265.pc sometimes doesn't located in "/usr/local/lib/pkgconfig" and instead it is located in "/usr/lib/arm-linux-gnueabihf/pkgconfig/", so, you needs to include it in the export also .
export PKG_CONFIG_PATH=/usr/lib/arm-linux-gnueabihf/pkgconfig/:/usr/local/lib/pkgconfig/
solution:
add --extra-libs=-lpthread
https://bitbucket.org/multicoreware/x265/issues/371/x265-not-found-using-pkg-config
It's need more library. Please install "libnuma".
I follow to guide from wiki x265
git clone https://bitbucket.org/multicoreware/x265_git
cd x265_git/build/linux
./make-Makefiles.bash
make
And works fine in Red Hat Enterprise Linux 8
You can try
--pkg-config="pkg-config --static"
I believe I found the solution. The issue appears to be that current guide is pulling from master (which may be what a developer wants) but in my case
I actually needed stable. Instead of using the provided command in the current guide:
sudo apt-get install libnuma-dev && \
cd ~/ffmpeg_sources && \
git -C x265_git pull 2> /dev/null || git clone --depth 1 https://bitbucket.org/multicoreware/x265_git && \
cd x265_git/build/linux && \
PATH="$HOME/bin:$PATH" cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="$HOME/ffmpeg_build" -DENABLE_SHARED=off ../../source && \
PATH="$HOME/bin:$PATH" make && \
make install
Use this command:
sudo apt-get install libnuma-dev && \
cd ~/ffmpeg_sources && \
git -C x265_git pull 2> /dev/null || git clone --depth 1 https://bitbucket.org/multicoreware/x265_git -b stable && \
cd x265_git/build/linux && \
PATH="$HOME/bin:$PATH" cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="$HOME/ffmpeg_build" -DENABLE_SHARED=off ../../source && \
PATH="$HOME/bin:$PATH" make && \
make install
I can't comment as I have too low reputation. I don't know what it's for :(
Anyway, I had the same problem and I had to do two of tricks mentioned above in solutions:
--extra-libs="-lpthread"
--pkg-config-flags="--static"
Add both of those switches and victory is yours.
I've also come across a case where the x265.pc is not generated, I know this wasn't the issue in original problem but thought worth mentioning.
This occurs if you don't have git installed, in my case I was building inside a container with pre-fetched sources on a corporate network.
This issue is documented at https://bitbucket.org/multicoreware/x265_git/issues/572/pc-file-is-not-generated
It can be worked around either by installing git or fudging it with something as simple as
touch git
chmod a+x git
export PATH="$PWD:PATH"
I'm desperately trying to compile Tesseract-ocr (4.0) on a Windows Machine with some restrictions.
We are doing multi-platforms : an automated compilation must be possible (command-line)
We are using specific 3rd party libraries : the compilation must accept custom path / libraries for most of its dependencies
We are already using most of the 3rd party libraries for other part of the code : the compilation must not recompile them (thus, no cppan)
Leptonica has been built with our special 3rdparty (ZLib, LibPng ..)
Our project must "include" tesseract alongside theses specific 3rdparty
Problem :
I have strong issue specifying custom paths for Tesseract.
Under Unix (CentOS, Ubuntu 16/18, Debian 8/9 ..), I was able to achieve my goal with the tools autogen autoconf autoheaders pkg-config.
Under Windows, autoconf-archive and pkg-config are unavailable (from what I tried) ; rendering autoconf unusable.
I was neither able to compile using CMake and specifying a custom path for Leptonica (even after writing a new pkgconfig for leptonica).
Things I tried :
Using MinGW and autoconf
Manually installing pkg-config
Cheating with autoconf-archive .m4 into aclocal
Creating a VisualStudio project with cppan and modify it
Various ways of telling CMake to search elsewhere for 3rdparty
Things that work on Linux :
Autoconf with modified PKGConfig for custom compiled Leptonica (--with-extra-libraries PKG_CONFIG_PATH CPPFLAGS LDFLAGS)
Things I have not tried :
Installing Leptonica on the machine (Not the point here)
Rewriting CMakeFiles
Unknown solutions ?
Possible Solutions
MinGW (Windows) with pkg-config autoconf-archive
Unknown way to tell CMake Leptonica custom path
VisualStudio project without cppan
Yours ?
Thank your for your interest.
EDIT 1
By trying various ways of manually installing pkg-config, Autoconf seemed to be unaware of its presence. This error was about pkg-config missing package (How to install pkg config in windows?).
CPPAN was deeply part of the visual studio project and I couldn't see how I could separate them.
I usually tell configure to look for leptonica package with the arguments --with-extra-libraries and PKG_CONFIG_PATH.
CMake however, uses the "macro" find_package(Leptonica $PATH CONFIG REQUIRED). By looking at it a little bit, I was (maybe) able to specify its path with CMAKE_PREFIX_PATH, CMAKE_MODULE_PATH, Leptonica_DIR. The compilation was still unsuccessfull due to missing config files (LeptonicaConfig.cmake or leptonica-config.cmake).
I pointed theses variables to various folders of the leptonica folder after building it.
For information, I built Leptonica with its configure as such :
bash configure --enable-shared=false --without-giflib --without-libwebp --without-libopenjpeg LDFLAGS="-LPATH/TO/ZLIB -LPATH/TO/LIBPNG .." CPPFLAGS="-IPATH/TO/ZLIB/INCLUDE ..."
I, however, was unable to locate theses files (while seeing a LeptonicaConfig.cmake.in under LeptonicaDir/cmake/template)
I hope I answered your questions. Please tell me if you need further details.
To compile tesseract-4.0.0 on Windows with MSYS and MinGW:
Prerequisites:
Download Tesseract OCR 4.0: https://github.com/tesseract-ocr/tesseract
Install MSYS2 (msys2-x86_64): https://www.msys2.org/
Extract tesseract-4.0.0.zip to C:/msys64/home/tesseract/tesseract-4.0.0
Open Start Menu > MSYS2 64bit > MSYS2 MSYS and run the following commands:
$ pacman -Syu
#### Close terminal window and open it again (MSYS2 MSYS) ###
$ pacman -Su
$ pacman -S base-devel
$ pacman -S mingw-w64-i686-toolchain
$ pacman -S mingw-w64-x86_64-toolchain
$ pacman -S mingw-w64-i686-cmake
$ pacman -S mingw-w64-x86_64-cmake
32-bit Compilation:
Open Start Menu > MSYS2 64bit > MSYS2 MinGW 32-bit and run the following commands:
$ cd /home/tesseract/tesseract-4.0.0
$ pacman -S mingw-w64-i686-leptonica
$ ./autogen.sh
$ ./configure --prefix=/home/tesseract/install/windows-i686
$ make -j4
$ make install
64-bit Compilation:
Open Start Menu > MSYS2 64bit > MSYS2 MinGW 64-bit and run the following commands:
$ cd /home/tesseract/tesseract-4.0.0
$ pacman -S mingw-w64-x86_64-leptonica
$ ./autogen.sh
$ ./configure --prefix=/home/tesseract/install/windows-x86_64
$ make -j4
$ make install
The compiled tesseract will be installed on: C:/msys64/home/tesseract/install
I downloaded GNU make 4.2.1 from here (make-4.2.1.tar.gz) and installed it following the instruction found in the INSTALL file that is present in the expanded folder.
Now I run make -v in the shell and I still get that the system sees the old version:
GNU Make 3.81
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
This program built for i386-apple-darwin11.3.0
Any suggestion?
I'm working on a macOS 10.12.3 machine.
Thanks in advance.
It is bad practice to alter the contents of /usr/bin. The best way is to have /usr/local/bin before /usr/bin in your PATH. Add the following to your ~/.bashrc :
[[ "$PATH" = */usr/local/bin* ]] || PATH="/usr/local/bin:$PATH"
Type command which make. If nothing unexpected happens, the shell will print out /usr/bin/make, which is the path of default make.
In INSTALL file:
By default, make install will install the package's files in
/usr/local/bin, /usr/local/man, etc. You can specify an
installation prefix other than /usr/local by giving configure the
option --prefix=PATH.
So maybe you can try make --prefix=/usr/bin. Or remove the default make create soft link for make in /usr/local/bin.
I am having trouble with pdftk on my Mac OS X 10.11 and want to remove all traces of it from my system before attempting to make a new install with the newest package 2.02 (available here on StackOverflow) which I already installed.
I suspect there might be more than one version in my system.
When I try
pdftk --version
the system gives an error:
dyld: Symbol not found: __ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED1Ev
Referenced from: /usr/local/bin/pdftk
Expected in: /usr/local/bin/../lib/libstdc++.6.dylib
in /usr/local/bin/pdftk
Trace/BPT trap: 5
and when I run
export DYLD_LIBRARY_PATH=/opt/pdflabs/pdftk/lib:$DYLD_LIBRARY_PATH
and check for the version I get
pdftk 2.02 a Handy Tool for Manipulating PDF Documents
Copyright (c) 2003-13 Steward and Lee, LLC - Please Visit: www.pdftk.com
This is free software; see the source code for copying conditions. There is
NO warranty, not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
How do I remove them from the system?
EDIT: I actually tried the "version" option on both places,
by going to each folder and typing
pdftk --version
I got the problem on the /usr/local folder, but the /opt folder printed the version. It seems I really do have two versions of pdftk on my computer and the default is the problematic one.
I do not know how to uninstall the default pdftk, but the pdftk binary in /opt/pdflabs/pdftk/bin/pdftk seems to use by default the correct libraries. So in the meantime you could just change your PATH (in .bashrc / .bash_profile) so that the pdftk you use by default if the good one with something like
export PATH=/opt/pdflabs/pdftk/bin:$PATH
In the /opt/pdflabs/pdftk/bin there is also a pdftk_uninstall.sh that will uninstall the /opt/pdflabs when necessary. I guess that will be when pdflabs releases an official updated pdftk that installs the good version in the default directories.
I found pdftk_uninstall.sh script on /opt/pdflabs/pdftk/bin/ directory.
I copy-past script with -f flag for rm command
rm -f /usr/share/man/man1/pdftk.1;rm -f "/opt/pdflabs/pdftk/man/pdftk"*;rm -f /usr/local/bin/pdftk;rm -f "/opt/pdflabs/pdftk/bin/pdftk"*;rm -f "/opt/pdflabs/pdftk/license_gpl_pdftk/reference/"*;rmdir "/opt/pdflabs/pdftk/license_gpl_pdftk/reference";rm -f "/opt/pdflabs/pdftk/license_gpl_pdftk/third_party/"*;rmdir "/opt/pdflabs/pdftk/license_gpl_pdftk/third_party";rm -f "/opt/pdflabs/pdftk/license_gpl_pdftk/"*;rmdir "/opt/pdflabs/pdftk/license_gpl_pdftk";rm -f "/opt/pdflabs/pdftk/changelog.html" "/opt/pdflabs/pdftk/changelog.txt"
This help for me 🎉
i recently got Oracle Solaris on my VM to test some code on it, i was unable to install gcc since i dont really know how, i googled alot but all info is about oracle compilers, i needed GCC, any idea where can i get GCC or how to install it?
thanks
The original answer applied to Solaris 11 Express/non-official release - if you're doing this today with a full release of Solaris 11.x, use the pkg install command like you see in xavier's response.
Run this command from your terminal to install GCC.
For GCC 3.4.x
pkg install gcc-3
For GCC 4.5.x
pkg install gcc-45
For GCC 4.7.x
pkg install gcc-47
For GCC 4.8.x
pkg install gcc-48
The gcc command should then already be placed in your path /usr/bin/gcc, which is a symlink).
Old Answer
Solaris 11 should already have gcc installed in /usr/sfw/bin/, but it's probably not in your PATH. Try this at the prompt: /usr/sfw/bin/gcc
Two steps:
pkg install gcc-45
pkg install system/header
that is all
if you see more info
http://blog.csdn.net/zjg555543/article/details/8217769
Just download gcc from its homepage, follow one of the mirror links to fetch the latest binary package (in .tar.gz or tar.bz2 format), and use traditional steps to build:
./configure --<> // give your options
make
make install
The good news is you can customize what you need and always stay with the latest, while bad part is you may lose the power to debug with mdb/adb - we are facing such problems with latest GCC 4.6.x
Solaris 10 and prior version :
/usr/sfw/bin/gcc works.
Solaris 11 :
pkg install gcc-3
pkg install gcc
worked for me
This will install entire gcc collection on your machine. Which anyways will be required
My Solaris 2.11 does NOT have internet access :/
What work for me:
(1) I use this link as guideline
(2) From my windows machine, download gcc at one of their mirror sites, i used here, normally the closer the better
(3) Upload gcc-9.2.0.tar.gz to target /tmp directory using WinSCP
(4) tar -xvf gcc-9.2.0.tar.gz
(5) cd gcc-9.2.0
(6) mkdir /usr/local/gcc
(7) cd /usr/local/gcc
(8) /tmp/gcc-9.2.0/configure -v --program-suffix=9.2
At this point, you might get this error:
Building GCC requires GMP 4.2+, MPFR 2.4.0+ and MPC 0.8.0+.
(9) Manually download the required files here.
Note: To know what files are required, check contrib/download_prerequisites
(10)Copy over the files in (9) to /tmp/gcc-9.2.0
(11)Extract, then create shortcuts: ln -s gmp-6.1.0 gmp, ln -s mpc-1.0.3 mpc, ln -s mpfr-3.1.4 mpfr, ln -s isl-0.18 isl
(12)/tmp/gcc-9.2.0/configure -v --program-suffix=9.2 --enable-languages=c,c++ -v
(13) nohup gmake & (At this point it's going to take some time...mine took ~6 hours. Use -j option if you can, to gmake it faster )
(14) gmake install
(15) /usr/local/bin# ./gcc9.2 --version
gcc9.2 (GCC) 9.2.0
Copyright (C) 2019 Free Software Foundation, Inc.
Voila! :-)
You can install gcc 4.3 from OpenCSW:
pkg-get -i gcc4code gcc4g++
I also had to run mkheaders manually after the install.
I had the same problem and 'pkg install gcc-3' worked for me.
I'll quote the answer from unix.stackexchange.com.
On Solaris 11 gcc is not installed by default. Normally you'll want more than just the compiler itself so my answer will include all the usual suspects for building open source software on Solaris that you've downloaded from somewhere in source code format.
By far the easiest is to use IPS to install it using the commands below (while being root or other superuser):
pkg install pkg://solaris/developer/build/gnu-make \
pkg://solaris/developer/build/make \
pkg://solaris/developer/gcc \
pkg://solaris/system/header \
pkg://solaris/developer/build/autoconf \
pkg://solaris/developer/build/automake
(I use fully qualified package names here, that is not really necessary)
Note that some of the packages are available in the official repo in various versions. If you just reference developer/gcc then you'll at the time of writing this get GNU C v4.8.2, but you may explicitly ask for a prior version, e.g. by using package name such as developer/gcc-45.