I am trying to install Inotify2 on freeBSD, but test step throws error.
cpan install Linux::Inotify2
It throws the following error:
root#freebsd12sabin:~/.cpan/build/Linux-Inotify2-2.1-6 # make test
"/usr/local/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- Inotify2.bs blib/arch/auto/Linux/Inotify2/Inotify2.bs 644
PERL_DL_NONLAZY=1 "/usr/local/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/00_load.t ..... Can't load '/root/.cpan/build/Linux-Inotify2-2.1-6/blib/arch/auto/Linux/Inotify2/Inotify2.so' for module Linux::Inotify2: /root/.cpan/build/Linux-Inotify2-2.1-6/blib/arch/auto/Linux/Inotify2/Inotify2.so: Undefined symbol "inotify_init" at /usr/local/lib/perl5/5.30/mach/DynaLoader.pm line 193.
at /root/.cpan/build/Linux-Inotify2-2.1-6/blib/lib/Linux/Inotify2.pm line 97.
BEGIN failed--compilation aborted at /root/.cpan/build/Linux-Inotify2-2.1-6/blib/lib/Linux/Inotify2.pm line 97.
Is there anyway I can proceed?
You need to use alternatives that work on the OS.
File::ChangeNotify with IO::KQueue
gamin and Sys::Gamin
Actually, there is devel/libinotify library, which implements inotify interface on FreeBSD via kevent API. So, there might be possible to build this extension.
If you got to Undefined symbol "inotify_init" stage, the only thing left is to install libinotify package and then add proper -l flag to build command line. I'm not familiar with Perl build system, so I can't advise on how to do that.
Inotify is a Linux specific API. You can't use it on FreeBSD (or any other OS not using a Linux kernel) because that kernel doesn't provide those syscalls.
Related
I'm trying to use the GNU Prolog Compiler to build an executable from my Prolog program like so:
$ gplc solution.prolog -o prog
and it's failing with a really cryptic error:
error trying to execute as: No such file or directory
I can't figure out what it's trying to tell me is missing. Does anyone know?
I'm using Fedora Silverblue 37, and glpc is running inside of a 'toolbox' that is also Fedora 37.
The issue appears to have been that I didn't have a C compiler installed. I installed the gcc package, and got a different error:
gcc: fatal error: cannot read spec file ‘/usr/lib/rpm/redhat/redhat-hardened-ld’: No such file or directory
Apparently to get that file, I needed to install the redhat-rpm-config package. I found that package name from this relevant comment on the RedHat bugzilla.
Compilation succeeds now!
enter image description here
I have basically tried every tutorial out there and still cant run valgrind.
So far....
I installed valgrind from their website to directory 'memcheck'
tar xvf valgrind-3.18.1.tar.bz2
the picture is the outcome of "./configure" ,I cant tell if it was successful or not.
then the command "make" gives: make: *** No targets specified and no makefile found. Stop.
and the same for "make install"
this is what i tried to do. How to install valgrind properly?
If the output from configure contains "configure: error:" then it failed.
Installing with your package manager will be easiest.
Otherwise, you will need
A C compiler (e.g., gcc or clang), always.
GNU make, always.
Perl, probably always.
Sed and awk, always.
Autotools, m4, if regenerating the configure script.
Lots of packages if you want to generate the docs.
A C++ compiler (g++ or clang++) if you want to build and run the regression tests.
I need LibXML in a Linux Machine and have the next error like other posts:
Can't locate XML/LibXML.pm in #INC
I saw the solution, but the problem that I have is that when try generate the library with cpan, show error that not found the compiler. I was looking the answer for my problem, and I found the way to install, with apt-get or mcpan, but not get apt-get or aptitude commands, I only can with ipkg install perl_libXML or with cpan.
The error with cpan is the next:
perl -MCPAN -e shell
Terminal does not support AddHistory.
cpan shell -- CPAN exploration and modules installation (v2.00)
Enter 'h' for help.
cpan[1]> install XML::LibXML
Reading '/root/.cpan/Metadata'
Database was generated on Sat, 01 Nov 2014 19:17:02 GMT
Running install for module 'XML::LibXML'
Running make for S/SH/SHLOMIF/XML-LibXML-2.0117.tar.gz
Checksum for /root/.cpan/sources/authors/id/S/SH/SHLOMIF/XML-LibXML-2.0117.tar.gz ok
Scanning cache /root/.cpan/build for sizes
............................................................................DONE
CPAN.pm: Building S/SH/SHLOMIF/XML-LibXML-2.0117.tar.gz
Use of uninitialized value $config_val in pattern match (m//) at inc/Devel/CheckLib.pm line 372.
Couldn't find your C compiler
Compilation failed in require at Makefile.PL line 92.
BEGIN failed--compilation aborted at Makefile.PL line 92.
Warning: No success on command[/usr/bin/perl Makefile.PL]
SHLOMIF/XML-LibXML-2.0117.tar.gz
/usr/bin/perl Makefile.PL -- NOT OK
Running make test
Make had some problems, won't test
Running make install
Make had some problems, won't install
Could not read metadata file. Falling back to other methods to determine prerequisites
Failed during this command:
SHLOMIF/XML-LibXML-2.0117.tar.gz : writemakefile NO '/usr/bin/perl Makefile.PL' returned status 512
cpan[2]>
I not know why with ipkg the installation is ok but after not work. I think with cpan would work if the process would found the c compiler, but I not know which is the problem or how tell to cpan the path to the compiler or if is neccesary install it.
I try to manual compile and this is the result, but I not understand why no funda the compilar, I have severas compiler un the sistem. Ťhe error is :
root#Linux: ~/.cpan/build/XML-LibXML-2.0117-tF5gWA # perl Makefile.PL DEBUG=1
Use of uninitialized value $config_val in pattern match (m//) at inc/Devel/CheckLib.pm line 372.
Couldn't find your C compiler
Compilation failed in require at Makefile.PL line 92.
BEGIN failed--compilation aborted at Makefile.PL line 92.
root#Kubyx: ~/.cpan/build/XML-LibXML-2.0117-tF5gWA #
Can you help me to solve the problem or compile by hand?
I found the answer to my system.
x86_64-linux-gnu-gcc is the executable to GCC binary supplied as argument to perl. So Devel::CheckLib is not finding the C compiler once my distro Ubuntu, don't create alternatives to x86_64-linux-gnu-gcc using gcc-5, version where I am using.
The workaround was to change to /usr/bin and create a symlink from x86_64-linux-gnu-gcc to x86_64-linux-gnu-gcc-5.
This is not the first time that I need symlink to alternative names of GCC. Ubuntu distro should create an alternative to all gcc version available and automatically manage the alternatives using update-alternatives.
I have encounter same error when install the XML::Parser:
Running install for module 'XML::Parser'
Checksum for /home/sss/.cpan/sources/authors/id/T/TO/TODDR/XML-Parser-2.46.tar.gz ok
Configuring T/TO/TODDR/XML-Parser-2.46.tar.gz with Makefile.PL
Couldn't find your C compiler
Compilation failed in require at Makefile.PL line 4.
BEGIN failed--compilation aborted at Makefile.PL line 4.
But I build a conda env and install by conda and work well. May work well with installing XML::LibXML.
build and activate conda env
conda create -n perl5 perl=5.26
conda activate perl5
Install XML::Parser by conda rather than cpan, and it will install the XML::Parser dependent libraries expat and libxml2 auto.
conda install -c conda-forge/label/gcc7 perl-xml-parser
# conda install XML::LibXML may be work
conda install -c bioconda perl-xml-libxml
Test the package install success
perl -MXML::Parser -e ''
perl -MXML::LibXML -e ''
Does Pintos have to be installed in a different way for the second Project (User Programs)? Whenever I try to run pintos -f -q on my installation, I get an error where Pintos doesn't recognize the arguments "-f".
Back to tcg accelerator.
PiLo hda1
Loading..........
Kernel command line: -f -q
Kernel PANIC at ../../threads/init.c:264 in parse_options(): unknown option `-f' (use -h for help)
Call stack: 0xc00283de.
The `backtrace' program can make call stacks useful.
Read "Backtraces" in the "Debugging Tools" chapter
of the Pintos documentation for more information.
This is where all the arguments are handled by Pintos:
http://www.cse.iitd.ernet.in/~sbansal/csl373/pintos/doc/pintos_html/init_8c-source.html
I can't find the definition of FILESYS anywhere either. Can someone please help me out here?
In utils/pintos change line number 259 to /home/<your home username>/<pintos dir>/src/userprog/build/kernel.bin
In utils/Pintos.pm change line number 362 to /home/<your home username>/<pintos dir>/src/userprog/build/loader.bin
Run make in userprog, utils again.
Had the same problem
You need to point the Kernel and Loader to the Kernel and Loader in userprog/build instead of threads/build as done while installing pintos
Good afternoon,
I am having difficulties with libxml2.
I tried to build the Perl module XML-LibXML which is part of our standard runtime environment. However, this time the installation on a RHEL5 box failed, because the build process complained about missing libxml2:
$> perl Makefile.PL LIB=/foo/lib/perl PREFIX=/foo INSTALLDIRS=site
enable native perl UTF8
running xml2-config...ok (2.7.6)
looking for -lxml2... no
looking for -llibxml2... no
libxml2 not found
However, the file was available. Starting the build with
perl Makefile.PL LIB=/usr/inform/target/lib/perl PREFIX=/usr/inform/target INSTALLDIRS=site
led to more evidence of the real problem:
[...]
Can't load 'blib/arch/auto/Conftest/Conftest.so' for module Conftest: /usr/inform/target/lib/libxml2.so.2: cannot restore segment prot after reloc: Permission denied at /usr/lib/perl5/5.8.8/i386-linux-thread-multi/DynaLoader.pm line 230.
at test.pl line 2
[...]
After some investigations I found that the problem appears to be that libxml2.so is created with text relocation:
[tess91#INF-AW] lib$ eu-findtextrel libxml2.so.2.7.6
the file containing the function 'get_crc_table' is not compiled with -fpic/-fPIC
the file containing the function 'crc32' is not compiled with -fpic/-fPIC
the file containing the function 'gzerror' is not compiled with -fpic/-fPIC
[...]
Ans since we have SElinux active on the target machine, linking against libxml.2 failed!
Is there any possibility to create libxml2 properly, or do I have to ask the admin to twist SElinux to allow relocations?
I really can't believe I am the olny one having this problem on Linux with SElinux active. What am I missing?
Any help apprecitated!
Regards,
Stefan
The simplest way is to have your administrator yum install libxml2-devel or even yum install perl-XML-LibXML. Otherwise, see if you can add -fPIC to the CFLAGS in the Makefile.PL.
I assume you are on 32-bit x86, any other architecture wouldn't work without -fPIC.
I just found a possible explanation:
During the build of libxml2 the compiler flag -fPIC is indeed used, so the code is created position independant, BUT:
When creating the shared library, the static libz is linked against it. Is that the source of my problem? That including a static lib in a shared executable taints the library by introducing non-relocatable code?
The fact that the symbols eu-findtextrel should already have pointed me in that direction, since crc32, get_crc_table, etc. look like encryption centered code...