How does one install coq-serapi for coq 8.10 using opam pin and ideally using a commit from coq-serapi? - coq

I tried finding the version compatible with coq 8.10 and installing it via opam pin but it's output is odd:
opam pin add -y coq-serapi git+https://github.com/ejgallego/coq-serapi.git#b6c7a46a8942b43cfd6a6e7d5fa3b155f17f1766
output:
(iit_synthesis) brando9~ $ opam pin add -y coq-serapi git+https://github.com/ejgallego/coq-serapi.git#b6c7a46a8942b43cfd6a6e7d5fa3b155f17f1766
[coq-serapi.8.10.0+0.7.2] synchronised (git+https://github.com/ejgallego/coq-serapi.git#b6c7a46a8942b43cfd6a6e7d5fa3b155f17f1766)
[WARNING] Failed checks on coq-serapi package definition from source at
git+https://github.com/ejgallego/coq-serapi.git#b6c7a46a8942b43cfd6a6e7d5fa3b155f17f1766:
warning 62: License doesn't adhere to the SPDX standard, see https://spdx.org/licenses/: "GPL 3"
coq-serapi is now pinned to git+https://github.com/ejgallego/coq-serapi.git#b6c7a46a8942b43cfd6a6e7d5fa3b155f17f1766 (version 8.10.0+0.7.2)
The following actions will be performed:
↻ recompile coq-serapi 8.10.0+0.7.2*
<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
⬇ retrieved coq-serapi.8.10.0+0.7.2 (git+https://github.com/ejgallego/coq-serapi.git#b6c7a46a8942b43cfd6a6e7d5fa3b155f17f1766)
[ERROR] The compilation of coq-serapi.8.10.0+0.7.2 failed at "dune build -p coq-serapi -j 127".
#=== ERROR while compiling coq-serapi.8.10.0+0.7.2 ============================#
# context 2.1.4 | linux/x86_64 | ocaml-base-compiler.4.07.1 | pinned(git+https://github.com/ejgallego/coq-serapi.git#b6c7a46a8942b43cfd6a6e7d5fa3b155f17f1766#b6c7a46a)
# path ~/.opam/coq-8.10/.opam-switch/build/coq-serapi.8.10.0+0.7.2
# command ~/.opam/coq-8.10/bin/dune build -p coq-serapi -j 127
# exit-code 1
# env-file ~/.opam/log/coq-serapi-807247-646161.env
# output-file ~/.opam/log/coq-serapi-807247-646161.out
### output ###
# Error: The implementation serlib/plugins/ltac/ser_tacentries.ml
# [...]
# type 'a grammar_tactic_prod_item_expr =
# 'a Ltac_plugin.Tacentries.grammar_tactic_prod_item_expr
# File "serlib/plugins/ltac/ser_tacentries.mli", line 19, characters 0-83:
# Expected declaration
# File "plugins/ltac/tacentries.mli", line 25, characters 0-156:
# Actual declaration
# (cd _build/default && /lfs/ampere1/0/brando9/.opam/coq-8.10/bin/ocamlopt.opt -w -40 -rectypes -g -ppx '.ppx/57e0400f3b219ff4fc65d1fbd820e35d/ppx.exe --as-ppx --cookie '\''library-name="serlib_ltac"'\''' -I serlib/plugins/ltac/.serlib_ltac.objs/byte -I serlib/plugins/ltac/.serlib_ltac.objs/native -I /lfs/ampere1/0/brando9/.opam/coq-8.10/lib/base/caml -I /lfs/ampere1/0/brando9/.opam/coq-8.10/li[...]
# File "plugins/ltac/tacenv.mli", line 74, characters 0-379:
# Error: This variant or record definition does not match that of type
# Ltac_plugin.Tacenv.ltac_entry
# The types for field tac_body are not equal.
<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
┌─ The following actions failed
│ λ build coq-serapi 8.10.0+0.7.2
└─
╶─ No changes have been performed
[NOTE] Pinning command successful, but your installed packages may be out of sync.
does someone know how to fix it? Is it just trying other commits until it works?
commits: https://github.com/ejgallego/coq-serapi/commits/b6c7a46a8942b43cfd6a6e7d5fa3b155f17f1766
related: requesting commit for coq-serapi from mantainer: https://github.com/ejgallego/coq-serapi/issues/319

Related

AOSP Android 12 Beta version build fails

I've tried to compile AOSP android 12 beta branches with no success.
I cloned the repo using:
repo init -u https://android.googlesource.com/platform/manifest -b refs/tags/android-s-beta-3
repo sync
and then used:
source build/envsetup.sh
lunch aosp_blueline-userdebug
m
now when it starts to run, after a while, it fails because there's duplication at the stub libraries:
[ 95% 86/90] out/soong/.bootstrap/bin/soong_build out/soong/build.ninja
FAILED: out/soong/build.ninja
cd "$(dirname "out/soong/.bootstrap/bin/soong_build")" && BUILDER="$PWD/$(basename "out/soong/.bootstrap/bin/soong_build")" && cd / && env -i "$BUILDER" --top "$TOP" --out "out/soong" -n "out" -d "out/soong/build.ninja.d" -t -l out/.module_paths/Android.bp.list -globFile out/soong/.bootstrap/build-globs.ninja -o out/soong/build.ninja --available_env out/soong/soong.environment.available --used_env out/soong/soong.environment.used Android.bp
error: build/soong/java/core-libraries/Android.bp:130:1: module "legacy.core.platform.api.stubs" already defined
libcore/mmodules/core_platform_api/Android.bp:182:1 <-- previous definition here
error: build/soong/java/core-libraries/Android.bp:146:1: module "stable.core.platform.api.stubs" already defined
libcore/mmodules/core_platform_api/Android.bp:198:1 <-- previous definition here
error: build/soong/java/core-libraries/Android.bp:164:1: module "legacy-core-platform-api-stubs-system-modules" already defined
libcore/mmodules/core_platform_api/Android.bp:216:1 <-- previous definition here
error: build/soong/java/core-libraries/Android.bp:180:1: module "stable-core-platform-api-stubs-system-modules" already defined
libcore/mmodules/core_platform_api/Android.bp:232:1 <-- previous definition here
error: libcore/JavaLibrary.bp:994:1: module "core.current.stubs" already defined
build/soong/java/core-libraries/Android.bp:27:1 <-- previous definition here
error: libcore/JavaLibrary.bp:1015:1: module "core-current-stubs-for-system-modules" already defined
build/soong/java/core-libraries/Android.bp:48:1 <-- previous definition here
error: libcore/JavaLibrary.bp:1041:1: module "core-current-stubs-system-modules" already defined
build/soong/java/core-libraries/Android.bp:74:1 <-- previous definition here
I've also tried to change the build/soong branch to master and I've got another build faliure.
How do I compile those beta versions? what am I missing??
Moreover, all the Android 12 betas I've tried are broken. For example, another beta 1 question
Thanks!
Ok so finally I've got this beta version compiled.
The thing I've found is that beta branch/ tag is not necessarily compiling.
So what I did is looking at:
https://android.googlesource.com/platform/
and when I ran into errors I've tried to checkout a later commit for this problematic sub-module that fixes this compilation.
Doing this until finding a combination of commits that compiled together did the magic.
If someone would like to know which specific commit I've checkout in order to get Android 12 beta 2 compiled just tell me
Actual problem is that this AOSP 12 Beta 3 is not fully synced and few of the modules were mentioned on different-2 files due to that you are getting these errors. I was also getting the same errors.
To get rid of these errors by commenting these modules in these files.
error: build/soong/java/core-libraries/Android.bp:130:1: module "legacy.core.platform.api.stubs" already defined
libcore/mmodules/core_platform_api/Android.bp:182:1 <-- previous definition here
build/soong/java/core-libraries/Android.bp line 130 you can comment this module.
/*java_library {
name: "legacy.core.platform.api.stubs",
visibility: core_platform_visibility,
hostdex: true,
compile_dex: true,
sdk_version: "none",
system_modules: "none",
static_libs: [
"art.module.public.api.stubs.module_lib",
"conscrypt.module.platform.api.stubs",
"legacy.i18n.module.platform.api.stubs",
],
patch_module: "java.base",
}*/
Same you have to do with other modules too.
https://stackoverflow.com/users/4618429/omribager Have you build AOSP 12 Beta 3 successfully if yes, please mention the process because after these fixes also I am getting other modules issue.
[100% 1/1] out/soong/.bootstrap/bin/soong_build out/soong/build.ninja
FAILED: out/soong/build.ninja
cd "$(dirname "out/soong/.bootstrap/bin/soong_build")" && BUILDER="$PWD/$(basename "out/soong/.bootstrap/bin/soong_build")" && cd / && env -i "$BUILDER" --top "$TOP" --out "out/soong" -n "out" -d "out/soong/build.ninja.d" -t -l out/.module_paths/Android.bp.list -globFile out/soong/.bootstrap/build-globs.ninja -o out/soong/build.ninja --available_env out/soong/soong.environment.available --used_env out/soong/soong.environment.used Android.bp
error: external/rust/crates/zip/Android.bp:21:1: "libzip" depends on undefined module "libflate2"
01:00:29 soong bootstrap failed with: exit status 1
failed to build some targets (01:08 (mm:ss))

How to write a spec file to build an rpm package?

How can I write a spec file for building an rpm package, if I have only 4 tasks?
Place my_file in /usr/local/mydir
Place the configuration file in the rsyslog.d
Place the logrotate file in logrptate.d
Echo "something" /etc/programm/programm.conf
My attempt:
1. Name: my_file
2. Version: 1.0
3. Release: 1
4. Summary: A sample package
5. Group: Applications/Productivity
6. License: GPL
7. Source0: my_file-1.0.tar.gz
8. BuildArch: i386
9. BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}.x86-64
10.
11. %description
12. This package basically does nothing, but it potentially could
13. do something useful.
14.
15.
16. %prep
17. %setup -q
18.
19. %build
20.
21.
22. %install
23. mkdir -p $RPM_BUILD_ROOT/usr/local/myfile
24.
25. install my_file $RPM_BUILD_ROOT/usr/local/myfile
26. install myfile-rsyslog.conf $RPM_BUILD_ROOT/etc/rsyslog.d
27.
28. install myfile-logrotate $RPM_BUILD_ROOT/etc/logrotate.d
29.
30. %files
31. %defattr(-,root,root)
32. /usr/local/myfile/my_file
33. /etc/rsyslog.d/myfile-rsyslog.conf
34. /etc/logrotate.d/myfile-logrotate
35.
36. %clean
37.
38. rm -rf $RPM_BUILD_ROOT
39.
40. %post
41. echo "something " >> /etc/programm/programm.conf
What did I understand wrong? Since I do not create a directory in %install, then when building rpm, the build tries to make an install to rsyslog.d and fails. What should be the correct sequence of actions? And then the task is simple - only 3 files, but solutions are offered everywhere difficult.
You are missing Requires and yes, you need to create those directories, if you want to install your files into them..
Somewhere between Line 9-11:
Requires: logrotate
Requires: rsyslog
Then in the install section:
%{__install} -Dm 0644 myfile-rsyslog.conf $RPM_BUILD_ROOT/etc/logrotate.d/myfile-rsyslog.conf
%{__install} -Dm 0644 myfile-logrotate $RPM_BUILD_ROOT/etc/rsyslog.d/myfile-logrotate
Here, %{__install} -Dm 0644 puts the file into the target directory and creates the target directory if it's missing. Your package shouldn't own the directory.

Error on building Openembedded for Intel Quark

Trying to build Linux for Advantech UBC-221 that has Intel Quark processor.
The system is Debian 9, running on VMware. Was able to build poky succefully before.
Let me summarize what I was doing:
mkdir quark
cd quark
git clone git://git.yoctoproject.org/meta-intel-quark
git clone git://git.openembedded.org/openembedded-core
git clone git://git.yoctoproject.org/poky
cp -r poky/bitbake .
cd openembedded-core
source oe-init-build-env
bitbake-layers add-layer ~/quark/meta-intel-quark/
bitbake core-image-base
Error code I get:
WARNING: Layer quark-bsp should set LAYERSERIES_COMPAT_quark-bsp in its conf/layer.conf file to list the core layer names it is compatible with.
WARNING: Layer quark-bsp should set LAYERSERIES_COMPAT_quark-bsp in its conf/layer.conf file to list the core layer names it is compatible with.
WARNING: /home/bgabor/quark/meta-intel-quark/recipes-kernel/linux/linux-yocto-quark_3.8.bb: Variable key RDEPENDS_${KERNEL_PACKAGE_NAME}-base (${KERNEL_PACKAGE_NAME}-image) replaces original key RDEPENDS_kernel-base ().
WARNING: /home/bgabor/quark/meta-intel-quark/recipes-bsp/grub/grub_0.97.bb: Exception during build_dependencies for CFLAGS
WARNING: /home/bgabor/quark/meta-intel-quark/recipes-bsp/grub/grub_0.97.bb: Error during finalise of /home/bgabor/quark/meta-intel-quark/recipes-bsp/grub/grub_0.97.bb
ERROR: ExpansionError during parsing /home/bgabor/quark/meta-intel-quark/recipes-bsp/grub/grub_0.97.bb
Traceback (most recent call last):
bb.data_smart.ExpansionError: Failure expanding variable CFLAGS, expression was -O2 -pipe -g -feliminate-unused-debug-types -fdebug-prefix-map=/home/bgabor/quark/openembedded-core/build/tmp-glibc/work/i586-oe-linux/grub/0.97+gitAUTOINC+5775f32a62-r0=/usr/src/debug/grub/0.97+gitAUTOINC+5775f32a62-r0 -fdebug-prefix-map=/home/bgabor/quark/openembedded-core/build/tmp-glibc/work/i586-oe-linux/grub/0.97+gitAUTOINC+5775f32a62-r0/recipe-sysroot= -fdebug-prefix-map=/home/bgabor/quark/openembedded-core/build/tmp-glibc/work/i586-oe-linux/grub/0.97+gitAUTOINC+5775f32a62-r0/recipe-sysroot-native= -Os -fno-strict-aliasing -Wall -Werror -Wno-shadow -Wno-unused -Wno-pointer-sign -DINTEL_QUARK_TEST=${#base_contains('PACKAGECONFIG', 'grub_test', '1', '0', d)} which triggered exception NameError: name 'base_contains' is not defined
Summary: There were 5 WARNING messages shown.
Summary: There was 1 ERROR message shown, returning a non-zero exit code.
I'm pretty much stuck here. Some help would be greatly appreciated!
Edit:
Tried to build on Debian 7.11 32 bit system. It went better however another error came:
bgabor#debian:~/quark/dizzy/build$ bitbake core-image-base
WARNING: Host distribution "Debian-7.11" has not been validated with this version of the build system; you may possibly experience unexpected failures. It is recommended that you use a tested distribution.
Loading cache: 100% |####################################################################################################################################################| ETA: 00:00:00
Loaded 1292 entries from dependency cache.
NOTE: Resolving any missing task queue dependencies
Build Configuration:
BB_VERSION = "1.24.0"
BUILD_SYS = "i686-linux"
NATIVELSBSTRING = "Debian-7.11"
TARGET_SYS = "i586-poky-linux"
MACHINE = "quark"
DISTRO = "poky"
DISTRO_VERSION = "1.7.3"
TUNE_FEATURES = "m32 i586"
TARGET_FPU = ""
meta
meta-yocto
meta-yocto-bsp = "dizzy:58863ad092c9a279e305c841dbb4353de2ecfae8"
meta-intel-quark = "master:a314f0ceea986fde42d5d9b0ea449f7a563e9351"
NOTE: Preparing runqueue
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
ERROR: Unable to install packages. Command '/home/bgabor/quark/dizzy/build/tmp/sysroots/i686-linux/usr/bin/smart --quiet --data-dir=/home/bgabor/quark/dizzy/build/tmp/work/quark-poky-linux/core-image-minimal-initramfs/1.0-r0/rootfs/var/lib/smart install -y busybox#i586 initramfs-live-install-efi#i586 run-postinsts#all initramfs-live-install#i586 udev#i586 initramfs-live-boot#quark base-passwd#i586' returned 1:
error: Can't install initramfs-live-install-1.0-r9#i586: no package provides grub
ERROR: Function failed: do_rootfs
ERROR: Logfile of failure stored in: /home/bgabor/quark/dizzy/build/tmp/work/quark-poky-linux/core-image-minimal-initramfs/1.0-r0/temp/log.do_rootfs.29435
ERROR: Task 240 (/home/bgabor/quark/dizzy/meta/recipes-core/images/core-image-minimal-initramfs.bb, do_rootfs) failed with exit code '1'
NOTE: Tasks Summary: Attempted 2529 tasks of which 2527 didn't need to be rerun and 1 failed.
No currently running tasks (2435 of 2531)
Summary: 1 task failed:
/home/bgabor/quark/dizzy/meta/recipes-core/images/core-image-minimal-initramfs.bb, do_rootfs
Summary: There was 1 WARNING message shown.
Summary: There were 2 ERROR messages shown, returning a non-zero exit code.
It does not find grub package, however I can see there are two in the recipes:
bgabor#debian:~/quark/dizzy/build$ bitbake-layers show-recipes | grep "grub" -A 3
Parsing recipes..done.
grub:
meta-intel-quark 0.97+gitAUTOINC+5775f32a62
meta 0.97
meta 2.00
--
grub-conf:
meta-intel-quark 1.0
grub-efi:
meta 2.00
gsettings-desktop-schemas:
meta 3.10.1
Tried to clean and then bitbake again but no result.
What might be the problem here?
First, Poky includes OpenEmbedded Core so you don't need to clone both, just clone Poky.
Second, the meta-intel-iot layer is pretty dead and only formally supports the Daisy release of Poky (see the README). You may have luck using newer releases, but obviously not git master (aka Thud).
https://wiki.yoctoproject.org/wiki/Releases lists the releases. Instead of checking out master of Poky, check out the relevant release branch. I suggest starting with daisy but trying something a little newer such as jethro would be a good idea.

Why does "Can not locate Debconf / Log.pm in #INC" issue? I just modified /usr/bin/perl into the perl that I installed

The system is Ubuntu. There is a perl in /usr/bin/, and is version is 5.18.2.
In this state, I tried to install many software by "sudo apt-get install **" and it was OK.
But a few days before, I installed a new perl in an other
directory(/share/Software/perl-5.26.0/bin/perl). And I remove the original perl then link the new perl to /use/bin/. The commands are:
sudo mv /usr/bin/perl /usr/bin/old/; (the old/ directory was make before)
sudo ln -s /share/Software/perl-5.26.0/bin/perl /usr/bin/perl
After that, I got the error informations when I install system software by apt-get. The error likes below:
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
debconf: Perl may be unconfigured (Can't locate Debconf/Log.pm in #INC (you may need to install the Debconf::Log module) (#INC contains: /share/Software/perl-5.26.0/lib/site_perl/5.26.0/x86_64-linux /share/Software/perl-5.26.0/lib/site_perl/5.26.0 /share/Software/perl-5.26.0/lib/5.26.0/x86_64-linux /share/Software/perl-5.26.0/lib/5.26.0) at (eval 1) line 4.
BEGIN failed--compilation aborted at (eval 1) line 4.
) -- aborting
Setting up doc-base (0.10.5) ...
Can't locate Debian/DocBase/Common.pm in #INC (you may need to install the Debian::DocBase::Common module) (#INC contains: /share/Software/perl-5.26.0/lib/site_perl/5.26.0/x86_64-linux /share/Software/perl-5.26.0/lib/site_perl/5.26.0 /share/Software/perl-5.26.0/lib/5.26.0/x86_64-linux /share/Software/perl-5.26.0/lib/5.26.0) at /usr/sbin/install-docs line 8.
BEGIN failed--compilation aborted at /usr/sbin/install-docs line 8.
Some software can be installed successfully, but some can not be.
If I put perl back to the previous, it is normal again. (That must be!)
Module "Debconf::Log" is located at /share/Software/perl-5.26.0/lib/perl5, but I can not find Debian/DocBase/Common.pm.
Path of /share/Software/perl-5.26.0/lib/perl5 is inside #INC of perl. Why it can not find it?
I even think that it is the problem when perl installed. I get below error when perl installed: ("make test")
Useless use of single ref constructor in void context at op/gv.t line 1191.
In file included from ../../../../perl.h:5644:0,
from ExtTest.xs:2:
ExtTest.c: In function ‘XS_ExtTest_constant’:
../../../../embed.h:691:40: warning: ‘pv’ may be used uninitialized in this function [-Wmaybe-uninitialized]
#define sv_setpvn(a,b,c) Perl_sv_setpvn(aTHX_ a,b,c)
^
ExtTest.xs:420:14: note: ‘pv’ was declared here
const char *pv;
^
In file included from ../../../../perl.h:5644:0,
from ExtTest.xs:2:
../../../../embed.h:691:40: warning: ‘iv’ may be used uninitialized in this function [-Wmaybe-uninitialized]
#define sv_setpvn(a,b,c) Perl_sv_setpvn(aTHX_ a,b,c)
^
ExtTest.xs:418:6: note: ‘iv’ was declared here
IV iv;
^
In file included from ../../../../perl.h:5644:0,
from ExtTest.xs:2:
ExtTest.c: In function ‘XS_ExtTest_constant’:
../../../../embed.h:691:40: warning: ‘pv’ may be used uninitialized in this function [-Wmaybe-uninitialized]
#define sv_setpvn(a,b,c) Perl_sv_setpvn(aTHX_ a,b,c)
^
ExtTest.xs:194:14: note: ‘pv’ was declared here
const char *pv;
^
In file included from ../../../../perl.h:5644:0,
from ExtTest.xs:2:
ExtTest.c: In function ‘XS_ExtTest_constant’:
../../../../embed.h:675:42: warning: ‘iv’ may be used uninitialized in this function [-Wmaybe-uninitialized]
#define sv_setiv_mg(a,b) Perl_sv_setiv_mg(aTHX_ a,b)
^
ExtTest.xs:166:6: note: ‘iv’ was declared here
IV iv;
^
# Failed test 'cp updated mtime'
# at t/cp.t line 26.
# '38'
# <=
# '1'
# Looks like you failed 1 test of 1.
Request to remove file /share/Software/perl-5.26.0-src/cpan/File-Temp/suffixOEXZVr.dat could not be completed since it is not there!
at t/mktemp.t line 75.
# parser guessed wrong encoding expected 'CP1252' got 'UTF-8'
# Failed test 'File 1 atime set correctly'
# at t/utime.t line 113.
# '37.684463262558'
# <
# '0.1'
# Failed test 'File 1 mtime set correctly'
# at t/utime.t line 114.
# '37.684463262558'
# <
# '0.1'
# Failed test 'File 2 atime set correctly'
# at t/utime.t line 118.
# '37.684463262558'
# <
# '0.1'
# Failed test 'File 2 mtime set correctly'
# at t/utime.t line 119.
# '37.684463262558'
# <
# '0.1'
# Looks like you failed 4 tests of 18.
Can't open copy1-87150: Permission denied at ../lib/File/Copy.t line 326.
# Looks like your test exited with 13 just after 366.
Failed 3 tests out of 2449, 99.88% okay.
### Since not all tests were successful, you may want to run some of
### them individually and examine any diagnostic messages they produce.
### See the INSTALL document's section on "make test".
### You have a good chance to get more information by running
### ./perl harness
### in the 't' directory since most (>=80%) of the tests succeeded.
### You may have to set your dynamic library search path,
### LD_LIBRARY_PATH, to point to the build directory:
### setenv LD_LIBRARY_PATH `pwd`:$LD_LIBRARY_PATH; cd t; ./perl harness
### LD_LIBRARY_PATH=`pwd`:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH; cd t; ./perl harness
### export LD_LIBRARY_PATH=`pwd`:$LD_LIBRARY_PATH; cd t; ./perl harness
### for csh-style shells, like tcsh; or for traditional/modern
### Bourne-style shells, like bash, ksh, and zsh, respectively.
make: *** [test] Error 1
Each Perl is compiled with a few #INC directories where it will search for modules. The error message explains which directories are searched:
#INC contains:
/share/Software/perl-5.26.0/lib/site_perl/5.26.0/x86_64-linux
/share/Software/perl-5.26.0/lib/site_perl/5.26.0
/share/Software/perl-5.26.0/lib/5.26.0/x86_64-linux
/share/Software/perl-5.26.0/lib/5.26.0
This does not include the directories where APT has installed modules for Perl, e.g. under /usr/lib.
However, adding those directories will not help. Some modules are compiled for a specific Perl versions. You cannot upgrade Perl in-place, but would have to reinstall all modules. Since APT contains pre-built modules you cannot use modules installed via APT with a custom Perl.
Therefore: leave the system Perl because Ubuntu depends on its proper functioning. It is safe to install another Perl alongside, e.g. via perlbrew. It is safe to add a custom Perl to your PATH, e.g. via perlbrew switch. This will also fix a couple of additional environment variables that are required for a second Perl to work.

"cpanm PHP" fails

What should I change in order to install the module? php is 5.3.3 withyum install php-devel in place.
PHP.c: In function ‘PHP_set_php_input’:
PHP.c:818: warning: passing argument 2 of ‘Perl_sv_2pv_flags’ from incompatible pointer type
/home/mpapec/.plenv/versions/5.20.0/lib/perl5/5.20.0/x86_64-linux/CORE/proto.h:3931: note: expected ‘STRLEN * const’ but argument is of type ‘int *’
cc -c -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -Wall -O2 -DVERSION=\"0.15\" -DXS_VERSION=\"0.15\" -fPIC "-I/home/mpapec/.plenv/versions/5.20.0/lib/perl5/5.20.0/x86_64-linux/CORE" array.c
In file included from /usr/include/php/main/php.h:33,
from /usr/include/php/sapi/embed/php_embed.h:23,
from PHP.h:14,
from array.c:9:
/usr/include/php/main/php_config.h:2417:1: warning: "_GNU_SOURCE" redefined
In file included from /home/mpapec/.plenv/versions/5.20.0/lib/perl5/5.20.0/x86_64-linux/CORE/perl.h:28,
from PHP.h:9,
from array.c:9:
/home/mpapec/.plenv/versions/5.20.0/lib/perl5/5.20.0/x86_64-linux/CORE/config.h:1825:1: warning: this is the location of the previous definition
rm -f blib/arch/auto/PHP/PHP.so
cc -shared -O2 -L/usr/local/lib -fstack-protector PHP.o array.o -o blib/arch/auto/PHP/PHP.so \
\
chmod 755 blib/arch/auto/PHP/PHP.so
"/home/mpapec/.plenv/versions/5.20.0/bin/perl5.20.0" -MExtUtils::Command::MM -e 'cp_nonempty' -- PHP.bs blib/arch/auto/PHP/PHP.bs 644
Manifying 1 pod document
Running Mkbootstrap for PHP ()
chmod 644 "PHP.bs"
PERL_DL_NONLAZY=1 "/home/mpapec/.plenv/versions/5.20.0/bin/perl5.20.0" "-Iblib/lib" "-Iblib/arch" test.pl
1..79
not ok 1 - use_ok PHP
# Failed test 'use_ok PHP'
# at test.pl line 11.
not ok 2 - require PHP;
# Failed test 'require PHP;'
# at test.pl line 18.
# Tried to require 'PHP'.
# Error: Attempt to reload PHP.pm aborted.
# Compilation failed in require at (eval 6) line 2.
not ok 3 - eval
# Failed test 'eval'
# at test.pl line 49.
Module PHP failed to load at blib/lib/PHP.pm line 80.
Module PHP failed to load at blib/lib/PHP.pm line 80.
END failed--call queue aborted at test.pl line 50.
# Looks like you planned 79 tests but ran 3.
# Looks like you failed 3 tests of 3 run.
# Looks like your test exited with 22 just after 3.
make: *** [test_dynamic] Error 22
-> FAIL Installing PHP failed. See /home/mpapec/.cpanm/work/1440522239.12833/build.log for details. Retry with --force to force install it.
(
PHP is kind of fragile. It probably won't work out of the box with your system php installation, and may have trouble with 64-bit or multi-threaded versions of perl.
I have only ever gotten it to work on Linux. The latest version I have tried to use is 5.3.8 (back in 2013), though I remember things going smoothly from 5.2.x to 5.3.8.
I always build php from source, with this configuration:
./configure --enable-embed --with-zlib --with-openssl --with-mysql \
--with-libdir=lib/i386-linux-gnu
--enable-embed is absolutely required, as the pod mentions, to build a PHP interpreter with the SAPI extension, and which then allows perl to manipulate the PHP interpreter through XS code. The other extensions were for other requirements of my project; they may be optional, but I haven't experimented with building the PHP interpreter or the PHP module with any other configuration. The pod also says to never use the --with-apxs argument, which I was never tempted to do anyway.
The build process of the PHP module will look for and require a program called php-config. You may need to hack your $PATH, if only during the build process, so that the PHP module runs the correct php-config. After that the module will know where to look for the rest of your php installation.
I had fun working with this module for a while (writing a Catalyst and then a Mojolicious wrapper around WordPress), but it has fallen into disrepair and disrepute. Share whatever you learn trying to build it and we'll put it in the docs, making this module that much easier to use.