Make install, but not to default directories?
It depends on the package. If the Makefile is generated by GNU autotools (./configure
) you can usually set the target location like so:
./configure --prefix=/somewhere/else/than/usr/local
If the Makefile is not generated by autotools, but distributed along with the software, simply open it up in an editor and change it. The install target directory is probably defined in a variable somewhere.
Why `make install` is deleting library files *.so generated by `make`?
This happens because:
-DCMAKE_INSTALL_PREFIX=./
means that you are installing over the top of the build directory itself,
with the result that for each filename in the cmake command:
file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/lib" TYPE SHARED_LIBRARY FILES
"path/poco/instDir/lib/libPocoEncodingsd.so.60"
"path/poco/instDir/lib/libPocoEncodingsd.so"
)
the source and destination files are the same. Cmake preemptively deletes the
destination file to replace it with the source file. Which means it has deleted
the source file. Hence your failure.
This behaviour may be a bug in cmake. On the face of it, if it checks and finds that the
destination file exists and has the same timestamp as the source file, it should consider
the destination file up to date and not attempt to replace it. But I haven't delved into that. Installing on top of your build directory is reasonably classified
under Don't do that.
Conventionally on Unix-like OSes, locally built packages shall be installed to/usr/local
. That's what /usr/local
is for. Cmake, like other source package
deployment tools, respects this convention by default. So if you simply run:
cmake -DCMAKE_BUILD_TYPE=Debug ../
make
sudo make install # Or however you run `make install` as root.
then the poco
libraries will be installed in /usr/local/lib
and the headers
in /usr/local/include/Poco
. /usr/local/lib
is a default library search path for the
linker and /usr/local/include
is a default header search path for the compiler.
If for some reason you don't want to install to the default prefix, then
choose some:
-DCMAKE_INSTALL_PREFIX=/not/in/the/build/dir
and you will avoid this problem.
how to modify the install-path without running the configure script/cmake again
CMake generated makefiles support the DESTDIR coding convention for makefiles. Thus you can override the default installation location by setting the DESTDIR
variable upon invoking make:
$ make install DESTDIR=/opt/local
There is no need to re-run CMake.
How to change the default installation directory to user home (on windows).?
In the media wizard, go to the "Installer options" step, select the "Use custom installation base directory" check box and enter ~
.
Create directory for configuration when running cargo install
Build Scripts are your friend.
The Rust file designated by the build
command (relative to the package root) will be compiled and invoked before anything else is compiled in the package, allowing your Rust code to depend on the built or generated artifacts. By default Cargo looks up for "build.rs" file in a package root (even if you do not specify a value for build).
Use build = "custom_build_name.rs"
to specify a custom build name, e.g. add in Cargo.toml
:
[package]
# ...
build = "custom_build_name.rs"
Related Topics
Error on Execution -Version 'Qt_5' Not Found Required By
Don't Fail Jenkins Build If Execute Shell Fails
How to Decode /Proc/Pid/Pagemap Entries in Linux
How to Set Memory Limit for Oom Killer for Chrome
Removing Part of a Filename for Multiple Files on Linux
How to Tell Linux Not to Swap Out a Particular Processes' Memory
How to Create a Dynamic Variable and Assign Value to It
Bash: Integer Expression Expected
Display Two Files Side by Side
Command Line Utility to Print Statistics of Numbers in Linux
Sending Udp Packets from the Linux Kernel
How to Have Simple and Double Quotes in a Scripted Ssh Command
Why Doesn't "Total" from Ls -L Add Up to Total File Sizes Listed
User-Data Scripts Is Not Running on My Custom Ami, But Working in Standard Amazon Linux