I am trying to build (and later upload) a conda package which would contain my custom program that I have developed in C++.
Simplifying the problem, I have a following meta.yaml:
package:
name: CoolName
version: "1.0.0"
source:
path: ./source
requirements:
build:
- make
and the following build.sh:
make
I have two questions here:
1) How and where should I copy the binary which is a result of the make compilation so that it is indeed recognized upon environment activation?
2) How should I specify g++ as a dependancy? I would like to have this package be later available for linux-64 and osx-64... In the building process (in the Makefile) I am using only g++.
Edit
I have modified my build script to have:
make
mkdir -p $PREFIX/bin
cp my_binary $PREFIX/bin/my_binary
And now the conda-build is successful. However, when I later try to install the package locally with conda install --use-local I get:
Collecting package metadata (current_repodata.json): done
Solving environment: done
# All requested packages already installed.
But this is not true, my binary is not installed anywhere and is not recognized...
How and where should I copy the binary which is a result of the make compilation so that it is indeed recognized upon environment activation?
As you mentioned in your edit, install somewhere within ${PREFIX}
How should I specify g++ as a dependancy?
To use conda-supplied compilers (rather than your system compiler), use this:
requirements:
build:
- {{ compiler('cxx') }}
I would like to have this package be later available for linux-64 and osx-64... In the building process (in the Makefile) I am using only g++.
Note: On Mac, it will use clang++, not g++. Make sure your Makefile respects the ${CXX} environment variable instead of hard-coding g++.
However, when I later try to install the package locally with conda install --use-local I get:
That is strange. conda install --use-local CoolName should do what you want. But here are some things to try:
Double-check the contents of the environment you're trying to install it into:
conda list
Try installing to a fresh environment:
conda create -n my-new-env --use-local CoolName
Delete any obsolete versions of the package you might have created before you successfully built the package:
# Inspect the packages you've created,
# and consider deleting all but the most recent one.
ls $(conda info --base)/conda-bld/linux-64/CoolName*.tar.bz2
...then try running conda install again.
I'm running this code from Github:
# Modify Makefile.config according to your Caffe installation.
cp Makefile.config.example Makefile.config
make -j8
# Make sure to include $CAFFE_ROOT/python to your PYTHONPATH.
make py
make test -j8
# (Optional)
make runtest -j8
And for the line:
make -j8
The output is:
bash: make: command not found
Which is I think it is because make is not a valid command. What packages should I install and how? I tried looking for it on the internet about the error that I was getting but no luck.
I thought it was CMake that I'm missing and actually installed it. I got this in my Program Files folder:
But it still gives out the same error.
i downloaded cmake but make is still not recognizable. So I downloaded make first then cmake afterwards then include it to my environmental variables. And I had to restart my laptop.
I am trying to install the openCV library for Python however I am new to CMake and have run into some trouble after having cloned the repository in ~/opencv.
I've made a build directory in it with the mkdir command however once inside it when trying to set CMake options in it.
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local
I get prompted with the following error:
CMake Error: The source directory "/Users/eDen/opencv/build/CMAKE_INSTALL_PREFIX=/usr/local" does not exist.
It seems you aren't making the right directory, some Mac OS X installations doesn't include /usr/local/. You can make the directory using, if it's not already created, with:
sudo mkdir /usr/local/
But you say you want to use OpenCV with Python. I recommend you to obtain an already compiled copy unless you need some advanced features not available in the compiled version, like Qt integration or CUDA programming. But these features are included in the arguments of the cmake command.
Instructions on how to obtain OpenCV from Homebrew repository, this page explains the process. Basically, you install Homebrew, then Python, configure it and install some dependencies.
As Tsyvarev mentioned in the comments, you need to specify the path to source directory (i.e. where the main CMakeLists.txt file exists) at the end of your command. So, supposing you are now in the build directory, the final cmake command would be as follows:
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local ..
I have the last argument as .. but still get the error.
In my case, there is a bad whitespace in the above arguments. So the last .. is ignored.
I have been trying to install numba in a virtual environment. Numba requires llvm and what seems to be a Python wrapper of llvmpy. I successfully installed it using the following steps:
wget http://llvm.org/releases/3.2/llvm-3.2.src.tar.gz
tar zxvf llvm-3.2.src.tar.gz
cd llvm-3.2.src
./configure --enable-optimized --prefix=/opt
REQUIRES_RTTI=1 make
make check-all
sudo REQUIRES_RTTI=1 make install
git clone git://github.com/llvmpy/llvmpy.git
cd llvmpy
sudo LLVM_CONFIG_PATH=/opt/bin/llvm-config /path/to/environment/bin/python setup.py install
python -c "import llvm; llvm.test()"
However, I would like to know what is the correct procedure. For example, in the line REQUIRES_RTTI=1 make and sudo REQUIRES_RTTI=1 make install, the variable REQUIRES_RTTI is repeated. Is it necessary?
According to the documentation of numba, it recommends to execute REQUIRES_RTTI=1 make install and llvmpy recommends REQUIRES_RTTI=1 make, so there are slight differences. I don't really know what each step is doing so I would appreciate a general explanation of what is going on and if all these steps are strictly necessary.
Furthermore, what is make check-all? I have seen it is particularly relevant in questions related to llvm but I don't know what is its purpose.
Another suggestion from llvmpy's documentation is to install using a different directory (--prefix) Why is that the recommended approach?
Thanks a lot
The following lines
REQUIRES_RTTI=1 make
sudo REQUIRES_RTTI=1 make install
use the way of setting up environment of the called process without modifying the environment of the calee (like in case of export REQUIRES_RTTI=1); from bash manual:
The environment for any simple command or function may be augmented
temporarily by prefixing it with parameter assignments. These assignment statements affect only the
environment seen by that command.
This setting is recommended because from LLVM docs:
Add REQUIRES_RTTI=1 to your environment
while running make to re-enable it. This will allow users to build
with RTTI enabled and still inherit from LLVM classes.
and according to llvmpy docs, RTTI is required.
So, forgetting this "complication" and standard requirement to use "sudo" for installing, the steps are standard:
### generating makefile:
./configure --enable-optimized --prefix=/opt
### building core libraries (make without target is the same as "make all")
make
### check-all is a makefile target that is used to run regression tests (according to LLVM docs)
make check-all
### installing the libraries to the place where other tools / libraries can find them:
make install
I have a problem installing package dionaea.
After I type this:
./configure --with-lcfg-include=/opt/dionaea/include/ \
--with-lcfg-lib=/opt/dionaea/lib/ \
--with-python=/opt/dionaea/bin/python3.1 \
--with-cython-dir=/usr/bin \
--with-udns-include=/opt/dionaea/include/ \
--with-udns-lib=/opt/dionaea/lib/ \
--with-emu-include=/opt/dionaea/include/ \
--with-emu-lib=/opt/dionaea/lib/ \
--with-gc-include=/usr/include/gc \
--with-ev-include=/opt/dionaea/include \
--with-ev-lib=/opt/dionaea/lib \
--with-nl-include=/opt/dionaea/include \
--with-nl-lib=/opt/dionaea/lib/ \
--with-curl-config=/opt/dionaea/bin/ \
--with-pcap-include=/opt/dionaea/include \
--with-pcap-lib=/opt/dionaea/lib/ \
--with-glib=/opt/dionaea
and the next step is:
#make
An error message appears:
make: *** No targets specified and no makefile found. Stop.
My directory is /usr/local/src
make takes a makefile as input. Makefile usually is named makefile or Makefile. The configure command should generate a makefile, so that make could be in turn executed. Check if a makefile has been generated under your working directory.
running ./configure should solve your problem.
I got the same error and i fixed it by looking at the solution from this site:
http://trac.macports.org/ticket/40476.
SO did you got any error after running './configure' ? Maybe something about lacking tclConfig.sh.
If so, instead of running './configure', you have to search for the tclConfigure.sh first and then put it in the command, in my case, its located in /usr/lib/. And then run:
'./configure ----with-tcl=/usr/lib --with-tclinclude=/usr/include'
./configure command should generate a makefile, named makefile or Makefile. if in the directory there is no this file, you should check whether the configure command execute success.
in my case, I configure the apr-util:
./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr/bin/apr-1-config
because the --with-apr=/usr/local/apr/bin/apr-1-config, the apr did not install yet, so there configure fail, there did not generate the apr's /usr/local/apr/bin/apr-1-config.
So I install the apr, then configure the apr-util, it works.
You had to have something like this:
"configure: error: "Error: libcrypto required."
after your ./configure runs. So you need to resolve noticed dependencies first and then try ./configure once more time and then run make !
I recently ran into this problem while trying to do a manual install of texane's open-source STLink utility on Ubuntu. The solution was, oddly enough,
make clean
make
If after ./configure Makefile.in and Makefile.am are generated and make fail (by showing this following make: *** No targets specified and no makefile found. Stop.) so there is something not configured well, to solve it, first run "autoconf" commande to solve wrong configuration then re-run "./configure" commande and finally "make"
Delete your source tree that was gunzipped or gzipped and extracted to folder and reextract again. Supply your options again
./configure --with-option=/path/etc ...
Then if all libs are present, your make should succeed.
This may happen if there is any read and write permission denial to the user. Like C:\Windows\System32\ have restricted access and you are cloned and trying to make from such restricted directory.
If you create Makefile in the VSCode, your makefile doesnt run. I don't know the cause of this issue. Maybe the configuration of the file is not added to system. But I solved this way. delete created makefile, then go to project directory and right click mouse later create a file and named Makefile. After fill the Makefile and run it. It will work.
Try
make clean
./configure --with-option=/path/etc
make && make install
In my case there was a file Makefile.PL in a database library:
http://www.cpan.org/modules/by-module/DBI/DBI-1.630.tar.gz
The following command created the makefile
perl Makefile.PL
After that, make command worked
I think that it can mean that ./configure command failed for some reason, in my case it was due to a missing package. So i have used my OS package manager to install required package (autoconf and autoconf-archive in my case), then it worked.
first time try
make clean
make
if these didn't solve your issue you have to install build packages.
debian base
apt-get install build-essential libgtk-3-dev
For RHEL/CentOS
sudo yum install gcc glibc glibc-common gd gd-devel -y
Step 1: Install the Required Dependencies
First, launch the Terminal and run the commands below to install the required dependencies and libraries.
sudo apt install autoconf automake libpcre3-dev libnl-3-dev libsqlite3-dev libssl-dev ethtool build-essential g++ libnl-genl-3-dev libgcrypt20-dev libtool python3-distutils
sudo apt install -y pkg-config
Step 2: Compile and Install
Now, run the commands below (one by one in order) to compile the source code and install Your Repo on your system.
[Before this enter you directory ex: cd folder_name]
sudo autoreconf -i
sudo ./configure --with-experimental --with-ext-scripts
sudo make
sudo make install
I hope this time problem will be solved.
You need to check the output of the configure command.
Mine contained this error:
configure: error: in `/home/ubuntu/build/php-8.0.19':
configure: error: The pkg-config script could not be found or is too old. Make sure it
is in your PATH or set the PKG_CONFIG environment variable to the full
path to pkg-config.
Then I googled the error and solved it.
Before running "make" you need to configure your build using "CMake"
Try:
cmake .
Creating Makefile in the VScode did not worked for me. So, delete the make file created in the VS code, go to the project directory and create file add all the commands in it and name it as Makefile and save. Then try to execute it in VS code. It will work. Don't know why it doesn't work with VS code.
Unpack the source from a working directory and cd into the file directory as root. Use the commands ./configure then make and make install