How can I install git on my webserver with a curl.h no such file error - linux

I have been trying to install Git on my web server. When i try "make install" i get the following errors which I cant seem to get past.
[root#site git-core-0.99.6]# make install
gcc -o http-pull.o -c -g -O2 -Wall '-DSHA1_HEADER=<openssl/sha.h>' http-pull.c
http-pull.c:6:23: error: curl/curl.h: No such file or directory
http-pull.c:7:23: error: curl/easy.h: No such file or directory
http-pull.c:16: error: expected â=â, â,â, â;â, âasmâ or â__attribute__â before â*â token
http-pull.c: In function âfetch_indexâ:
http-pull.c:102: warning: implicit declaration of function âcurl_easy_setoptâ
There is alot more of that if you need to see it, but though part of it would cover the issue

It looks like you're missing the curl development package, maybe if you install the source available here (or with the package manager of your distribution), it will work better.
For example, under debian, install libcurl4-gnutls-dev

Related

Mozilla syncstorage-rs installation / make fails under RHEL8

I'm currently trying to install Mozilla syncstorage-rs on a RockyLinux machine, and step by step I could reduce the amount of errors, but now I got stuck. I found in Makefile to execute the following command in case of SSL trouble, so I did so cargo build --features grpcio/openssl
and this is fine, this finally works:
cargo build --features grpcio/openssl
Compiling syncstorage v0.10.2 (/var/www/html/syncstorage-rs)
Finished dev [unoptimized + debuginfo] target(s) in 35.59s
But when I try to now run either make run or make test or anything else, I just get:
= note: /usr/bin/ld: /var/www/html/syncstorage-rs/target/debug/deps/libopenssl-dc6f50ea1194640f.rlib(openssl-dc6f50ea1194640f.openssl.9bacb62b-cgu.1.rcgu.o): undefined reference to symbol 'OPENSSL_cipher_name##OPENSSL_1_1_1'
//usr/lib64/libssl.so.1.1: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
= help: some `extern` functions couldn't be found; some native libraries may need to be installed or have their path specified
= note: use the `-l` flag to specify native libraries to link
= note: use the `cargo:rustc-link-lib` directive to specify the native libraries to link with Cargo (see https://doc.rust-lang.org/cargo/reference/build-scripts.html#cargorustc-link-libkindname)
error: could not compile `syncstorage` due to previous error
make: *** [Makefile:45: test] Error 101
What am I missing? I thought after building it could be run easily.
So the answer is to use cargo clean before continuing. I don't know why, but there seemed to be some old artifacts even if I hadn't built before. However, after executing cargo clear command, the build openssl runs completely (many lines more than before) and after that, there is one more little step to do:
python3 -m venv venv # creates a virtual environment named "venv"
source venv/bin/activate # enters the virtual environment
python3 -m pip install -r requirements.txt # installs the packages
and finally make run works.
For more details, see https://github.com/mozilla-services/syncstorage-rs/issues/1241
See https://www.youtube.com/watch?v=jdtoyIW4Lec
for a step by step instruction.

An error occurred while executing the "make" command while compiling and installing the "ModSecurity- Nginx" module

I am getting the error below while compiling and installing the "ModSecurity- Nginx" module.
Installing the "ModSecurity- Nginx" module
#yum install -y gcc-c++ flex bison yajl yajl-devel curl-devel curl GeoIP-devel doxygen zlib-devel pcre-devel lmdb-devel libxml2-devel ssdeep-devel lua-devel libtool autoconf automake
#cd /root
#git clone https://github.com/SpiderLabs/ModSecurity-nginx.git
#yum install libmodsecurity-devel
#cd /root/nginx-1.10.3/
#./configure --prefix=/opt/nginx --add-module=/root/ModSecurity-nginx
Compiling
#make **(Now start reporting errors)**
ERROR
/opt/ModSecurity-nginx/src/ngx_http_modsecurity_module.c: In function ‘ngx_http_modsecurity_create_ctx’:
/opt/ModSecurity-nginx/src/ngx_http_modsecurity_module.c:259:9: error: implicit declaration of function ‘msc_new_transrror=implicit-function-declaration] ctx->modsec_transaction = msc_new_transaction_with_id(mmcf->modsec, mcf->rules_set, (char *) s.data, r->conne
/opt/ModSecurity-nginx/src/ngx_http_modsecurity_module.c:259:33: error: assignment makes pointer from integer without ctx->modsec_transaction = msc_new_transaction_with_id(mmcf->modsec, mcf->rules_set, (char *) s.data, r->conne
cc1: all warnings being treated as errors
make[1]: *** [objs/addon/src/ngx_http_modsecurity_module.o] Error 1
make[1]: Leaving directory `/root/nginx-1.16.1'
make: *** [build] Error 2
The ModSecurity nginx connector compilation is failing because it can't find the ModSecurity headers. Every time a ModSecurity function is called, it's the first time the compiler is hearing about the existence of said function, thus making this an "implicit" function declaration.
To make a long story short, you need to specify where the compiler can find the ModSecurity headers and libraries. To do this, you're supposed to set two environment variables before configuring or compiling the connector module.
export MODSECURITY_INC="/opt/ModSecurity/headers/"
export MODSECURITY_LIB="/opt/ModSecurity/src/.libs/"
These paths were taken straight from the documentation, so you'll need to adjust them depending on where yum installed the libmodsecurity-devel package.
You can find the recipes for building the ModSecurity module and the ModSecurity nginx connector here and here, respectively.

Error installing nokogiri: Failed to build gem native extension

I want to execute the following command
bundle install && rake install
but an error comes up and I try to figure out whats going on. I found that i need to install nokogiri. But when I try to install it an error comes up again. Any ideas? :/
sudo gem install nokogiri -v '1.8.5'
Building native extensions. This could take a while...
ERROR: Error installing nokogiri:
ERROR: Failed to build gem native extension.
current directory: /var/lib/gems/2.5.0/gems/nokogiri-1.8.5/ext/nokogiri
/usr/bin/ruby2.5 -r ./siteconf20181210-12550-orku3c.rb extconf.rb
checking if the C compiler accepts ... yes
Building nokogiri using packaged libraries.
Using mini_portile version 2.3.0
checking for gzdopen() in -lz... no
zlib is missing; necessary for building libxml2
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/bin/$(RUBY_BASE_NAME)2.5
--help
--clean
--use-system-libraries
--enable-static
--disable-static
--with-zlib-dir
--without-zlib-dir
--with-zlib-include
--without-zlib-include=${zlib-dir}/include
--with-zlib-lib
--without-zlib-lib=${zlib-dir}/lib
--enable-cross-build
--disable-cross-build
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/var/lib/gems/2.5.0/extensions/x86_64-linux/2.5.0/nokogiri-1.8.5/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in /var/lib/gems/2.5.0/gems/nokogiri-1.8.5 for inspection.
Results logged to /var/lib/gems/2.5.0/extensions/x86_64-linux/2.5.0/nokogiri-1.8.5/gem_make.out

Cabal install current package into its own .cabal-sandbox/*-packages.conf.d

I have a package named commands. I want to install it into its own sandbox e.g. .cabal-sandbox/x86_64-osx-ghc-7.8.3-packages.conf.d/commands-0.0.0-f3f84f48f42ac74a69ee5fd73512bfd0.conf. currently, there is just one .hi interface file for one module Commands, I don't know how it got there.
I tried cabal install commands, by the logic of "that's how the other packages got there I think", but it fails with unknown package.
I also tried stuff with ghc-pkg like ghc-pkg update commands -f .cabal-sandbox/x86_64-osx-ghc-7.8.3-packages.conf.d but I'm not using them right. ideally, I'd like to do this with cabal.
the last thing I tried was ghc -idist/build/, but it complained about the package names in the interface files being different, command versus main ("... differs from name found in the interface file ..."). and if I faked the executable's package with ghc -package-name commands-0.0.0, the linker complained that it couldn't find the symbol _ZCMain_main_closure, because every executable needs the function main in the module Main in the package main.
I'm sure there's a better way of doing this.
I followed online examples for my cabal file:
$ cat commands.cabal
name: commands
library
exposed-modules: Commands.Types, Commands.Bits
...
the minimal failing code example is just:
$ cat Main.hs
import Commands.Types
main = return ()
in the root project directory.
Context: I need to build my executable with make (not cabal) because it links to foreign code (Objective-C via language-c-inline). my makefile: https://github.com/sboosali/Haskell-DragonNaturallySpeaking/blob/master/Makefile). thus, I have to compile a script explicitly. I don't know how to compile the executable with cabal, but I want cabal to build and test and manage my library.
By putting my package into the sandbox, I will be able to import its modules from the script, by compiling with cabal exec -- ghc. I will also be able to include the script with extra-source-files at least, and know it will work.
Here's what I'd try:
First unregister any previous commands library. Try
ghc-pkg --global unregister commands
Install new commands to your sandbox.
From your sandbox directory, try this:
cabal --enable-shared --disable-documentation --prefix=./ install /path/to/your/library/source
Note the prefix specification.
I nuked it (rm -fr .cabal-sandbox/), reinstalled everything (cabal install --only-dependencies), added itself as a source (cabal sandbox add-source .), installed it (cabal install command). and then make worked. idk...

OCaml Compile Error: /usr/bin/ld: cannot find -lstr

I am trying to compile the source code of MEGAM Ocaml library on an Ubuntu 64 machine.
I have OCaml installed (v 3.12.1), using sudo apt-get install ocaml.
I am having an issue when running the "make" command in the terminal on the unzipped source code, with OCaml returning the error:
/user/bin/ld: cannot find -lstr
collect2: error: ld returned 1 exit status
The makefile is producing the following two commands:
ocamldep *.ml > .depend
No error when run
ocamlc -g -custom -o megam str.cma -cclib -lstr bigarray.cma -cclib -lbigarray unix.cma -cclib -lunix -I /usr/lib/ocaml/caml fastdot_c.c fastdot.cmo intHashtbl.cmo arry.cmo util.cmo data.cmo bitvec.cmo cg.cmo wsemlm.cmo bfgs.cmo pa.cmo perceptron.cmo radapt.cmo kernelmap.cmo abffs.cmo main.cmo
Throws the error above when run.
I've tried removing the -lstr from the compile command, it stopped throwing that particular error but started throwing another error (Reference to undefined global 'Bigarray'), which is making me thing it might all be something I missed during the OCaml installation, some kind of PATH or reference I needed to set.
Any help is really appreciated, even if its just a shot in the dark, as am really struggling to come up with anything!
The instructions given here allow me to compile with no error. It boils down to:
locate libcamlstr
which tells me that libcamlstr can be found in /usr/lib/ocaml (YMMV), so I do:
cd /usr/lib/ocaml
sudo ln -s libcamlstr.a libstr.a
Then I'm able to compile the project:
cd /usr/local/src/cil
make clean && ./configure && make
You could just change the makefile from
-lstr
to
-lcamlstr
See the last comment in this bug in the OCaml bug tracker:
Bug 5247

Resources