It seems the CuDNN installer looks for the wrong version of CUDA. What am I doing wrong? The story in full:
Ubuntu 16.04
Two versions of CUDA installed, 9.0 and 9.1. /usr/lib/cuda links to the 9.1 installation, and LD_LIBRARY_PATH seems to point to that one:
$ echo $LD_LIBRARY_PATH
/usr/local/cuda/lib64:/usr/local/lib
$ ls -l /usr/local
lrwxrwxrwx 1 root root 8 jan 22 2018 cuda -> cuda-9.1
drwxr-xr-x 15 root root 4096 dec 1 2017 cuda-9.0
drwxr-xr-x 15 root root 4096 jan 22 2018 cuda-9.1
Now I did have CuDNN 7.0 installed, wanted to replace it with version 7.1. (That may have been an unwise decision, but, I already started doing it!)
Downloaded debian installers for CuDNN 7.1.3, to go with CUDA 9.1. Tried to install it thus:
$ sudo dpkg -i libcudnn7_7.1.3.16-1+cuda9.1_amd64.deb
(Reading database ... 261910 files and directories currently installed.)
Preparing to unpack libcudnn7_7.1.3.16-1+cuda9.1_amd64.deb ...
Unpacking libcudnn7 (7.1.3.16-1+cuda9.1) over (7.1.3.16-1+cuda9.1) ...
Setting up libcudnn7 (7.1.3.16-1+cuda9.1) ...
Processing triggers for libc-bin (2.26-0ubuntu2.1) ...
/sbin/ldconfig.real: /usr/local/cuda-9.0/targets/x86_64-linux/lib/libcudnn.so.7 is not a symbolic link
As you can see, the installer looks in the cuda-9.0 directory after the library files. (Why?) The file exists but it is not a symbolic link:
$ ls -l /usr/local/cuda-9.0/targets/x86_64-linux/lib/libcudnn.so
-rwxr-xr-x 1 root root 287624224 jan 16 2018 /usr/local/cuda-9.0/targets/x86_64-linux/lib/libcudnn.so
I also tried to remove libcudnn, but I did that after the first attempt of reinstalling, so removal throws the same kind of error:
$ sudo apt-get remove libcudnn7
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
cuda-9-0 cuda-command-line-tools-9-0 cuda-core-9-0 cuda-cublas-9-0
cuda-cublas-dev-9-0 cuda-cudart-9-0 cuda-cudart-dev-9-0 cuda-cufft-9-0
cuda-cufft-dev-9-0 cuda-curand-9-0 cuda-curand-dev-9-0 cuda-cusolver-9-0
cuda-cusolver-dev-9-0 cuda-cusparse-9-0 cuda-cusparse-dev-9-0
cuda-demo-suite-9-0 cuda-documentation-9-0 cuda-driver-dev-9-0
cuda-libraries-9-0 cuda-libraries-dev-9-0 cuda-license-9-0
cuda-misc-headers-9-0 cuda-npp-9-0 cuda-npp-dev-9-0 cuda-nvgraph-9-0
cuda-nvgraph-dev-9-0 cuda-nvml-dev-9-0 cuda-nvrtc-9-0 cuda-nvrtc-dev-9-0
cuda-runtime-9-0 cuda-samples-9-0 cuda-toolkit-9-0 cuda-visual-tools-9-0
libatk-wrapper-java libatk-wrapper-java-jni python-cliapp python-markdown
python-ttystatus
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
libcudnn7 libcudnn7-dev
0 upgraded, 0 newly installed, 2 to remove and 18 not upgraded.
After this operation, 680 MB disk space will be freed.
Do you want to continue? [Y/n]
(Reading database ... 261909 files and directories currently installed.)
Removing libcudnn7-dev (7.1.3.16-1+cuda9.1) ...
update-alternatives: removing manually selected alternative - switching libcudnn to auto mode
Removing libcudnn7 (7.1.3.16-1+cuda9.1) ...
Processing triggers for libc-bin (2.26-0ubuntu2.1) ...
/sbin/ldconfig.real: /usr/local/cuda-9.0/targets/x86_64-linux/lib/libcudnn.so.7 is not a symbolic link
So, the bigger picture: My goal is to get CuDNN 7.1 properly installed. How do I go about to achieve that goal?
I finally managed! I went in and manually removed the .so files:
$ cd /usr/local/cuda-9.0/targets/x86_64-linux/lib/
$ sudo mv libcudnn.so bak_libcudnn.so
$ sudo mv libcudnn.so.7 bak_libcudnn.so.7
$ sudo mv libcudnn.so.7.0.5 bak_libcudnn.so.7.0.5
then installing with dpkg, and reinstalling my tensorflow-gpu which confirmed that everything finally worked:
2018-11-30 09:40:39.478559: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1115] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 2123 MB memory) -> physical GPU (device: 0, name: Quadro M2000M, pci bus id: 0000:01:00.0, compute capability: 5.0)
Related
Earlier I was using Notepad++ and its not user friendly. So I've installed notepadqq now and trying to remove notepad++.
I tried to do but not able to find the package
root#ahamed:/home/ahamed/snap# sudo apt remove notepad-plus-plus
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package notepad-plus-plus
root#ahamed:/home/ahamed/snap#
Now i can see two packages in my machine
root#ahamed:/home/ahamed/snap# ls -ltr
total 8
drwxr-xr-x 4 ahamed ahamed 4096 Aug 1 12:01 notepadqq
drwxr-xr-x 4 ahamed ahamed 4096 Aug 1 12:13 notepad-plus-plus
root#ahamed:/home/ahamed/snap#
I can see that notepad++ works in .exe format. It really looks weird. Could someone help me on this
root#ahamed:/home/ahamed/snap# ps -ef|grep notepad
ahamed 16309 2113 0 12:14 tty2 00:00:00 bash /snap/notepad-plus-plus/85/bin/notepad-plus-plus
ahamed 16421 16309 0 12:14 tty2 00:00:04 /home/ahamed/snap/notepad-plus-plus/85/notepad-plus-plus/notepad-plus-plus.exe
ahamed 16424 1 0 12:14 ? 00:00:03 /snap/notepad-plus-plus/85/bin/wineserver
root 17134 11542 0 12:23 pts/0 00:00:00 grep --color=auto notepad
root#ahamed:/home/ahamed/snap#
List the installed softwares using the following command, and you will get the list:
kswajih#kswajih:~$ sudo snap list
Name Version Rev Tracking Publisher Notes
core 16-2.33.1 4917 stable canonical core
notepad-plus-plus 7.5.8 85 stable mmtrt -
sublime-text 3176 22 stable snapcrafters classic
vscode 1.25.1-1531323788 44 stable flexiondotorg classic
Now use the following command to remove installed packages, in your case its notepad-plus-plus:
kswajih#kswajih:~$ sudo snap remove notepad-plus-plus
notepad-plus-plus removed
Hope it helps.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
I installed Tensorflow 1.6.0 - GPU version with anaconda in a Python 3.6.4 environment.
When I do import tensorflow as tf, I get the following error:
ImportError: libcudnn.so.7: cannot open shared object file: No such file or directory
The different versions:
cudnn : 7.1.1
cuda : 9.0.176
tensorflow : 1.6.0
Ubuntu : 16.04
I am aware of this but it did not solve my problem.
The accepted answer is wrong (installing nvidia-cuda-toolkit). By installing the toolkit you are basically installing a second CUDA on top of already installed cuda from the nvidia guide.
The problem turned out to be an issue with symbolic links. Inspiration is from this topic http://queirozf.com/entries/installing-cuda-tk-and-tensorflow-on-a-clean-ubuntu-16-04-install
but the actual resolution is different
So at one point during CuDNN installation nvidia tutorial will ask you to do this:
sudo cp cuda/include/cudnn.h /usr/local/cuda/include
sudo cp cuda/lib64/libcudnn* /usr/local/cuda/lib64
sudo chmod a+r /usr/local/cuda/include/cudnn.h /usr/local/cuda/lib64/libcudnn*
The problem with this approach is that copying files with filter libcudnn* will break the symbolic links of the copied files. Instead, I suggest runnign following command, but it will still break the links:
sudo cp --preserve=links cuda/lib64/libcudnn* /usr/local/cuda/lib64
You can verify the links by running ls -lha libcudnn* in /usr/local/cuda/lib64 folder. If you happen to not see a picture like this:
lrwxrwxrwx 1 root root 13 May 2 20:02 libcudnn.so -> libcudnn.so.7
lrwxrwxrwx 1 root root 17 May 2 20:02 libcudnn.so.7 -> libcudnn.so.7.6.5
-rwxr-xr-x 1 root root 409M May 2 20:02 libcudnn.so.7.6.5
-rw-r--r-- 1 root root 386M May 2 20:02 libcudnn_static.a
Then you just found the problem. The actual solution is involving doing the following:
sudo rm /usr/local/cuda/lib64/libcudnn.so
sudo rm /usr/local/cuda/lib64/libcudnn.so.7
cd /usr/local/cuda/lib64/
sudo ln -s libcudnn.so.7.6.5 libcudnn.so.7
sudo ln -s libcudnn.so.7 libcudnn.so
Remove the old "links" and create new ones. Verify the links again with ls -lha libcudnn*. After that run following command in verbose mode:
sudo ldconfig -v
CHECK the logs. I don't know exactly what it does, but it turned out that it is something very important. Also, if the log says that symbolic link is broken or something along these lines then the tensorflow will continue to show the error mentioned in the subject.
BONUS! make sure you have following paths appended as the last lines nano ~/.bashrc
export PATH=/usr/local/cuda/bin:/opt/nvidia/nsight-compute/2019.4.0${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
export CUDADIR=/usr/local/cuda${CUDADIR:+:${CUDADIR}}
export CUDA_HOME=/usr/local/cuda
and then run the command source ~/.bashrc
All of the above steps assume that you did NOT use the nvidia-cuda-toolkit, but instead used nvidia cuda repo.
Also when installing CUDA make sure you are not targeting the 10.2. On the momenent of writing TF supports versions up to Cuda 10.1, so following is the right way of installing the necessary version:
sudo apt-cache policy cuda
sudo apt-get install cuda=10.1.243-1
Verifications by:
nvcc --version
nvidia-smi
EDIT: I found the error that you should AVOID seeing after running the ldconfig command:
/usr/local/cuda-10.1/targets/x86_64-linux/lib:
...
libnppist.so.10 -> libnppist.so.10.2.0.243
libcuinj64.so.10.1 -> libcuinj64.so.10.1.243
> /sbin/ldconfig.real: /usr/local/cuda-10.1/targets/x86_64-linux/lib /libcudnn.so.7 is not a symbolic link
libcudnn.so.7 -> libcudnn.so.7.6.5
libnppc.so.10 -> libnppc.so.10.2.0.243
libnppicom.so.10 -> libnppicom.so.10.2.0.243
libnvgraph.so.10 -> libnvgraph.so.10.1.243
/usr/lib/x86_64-linux-gnu/libfakeroot:
...
If you see it, then something is still misconfigured.
I don't have enough reputations to comment on Alex's answer. But now on Ubuntu 20.04 the paths have been changed! Also, no need to --preserve=links now when doing cp! So I should probably post a new answer:
Install cuDNN library 7.6 for TensorFlow 2.3.1 with CUDA 10.1, in an environment created by conda create --name tfgpu10.1 python=3.8:
Go to https://developer.nvidia.com/cuDNN
Download "cuDNN Library for Linux" in "Download cuDNN v7.6.5 (November 5th, 2019), for CUDA 10.1"
Extract using tar -xvzf cudnn-10.1-linux-x64-v7.6.5.32.tgz
"Install" files:
sudo cp cuda/include/cudnn.h /usr/lib/cuda/include/
sudo cp cuda/lib64/libcudnn* /usr/lib/cuda/lib64/
Set permission:
sudo chmod a+r /usr/lib/cuda/include/cudnn.h /usr/lib/cuda/lib64/libcudnn*
Output of testing:
Python 3.8.5 (default, Sep 4 2020, 07:30:14)
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
2020-12-02 03:58:41.089993: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library libcudart.so.10.1
>>> tf.config.list_physical_devices("GPU")
2020-12-02 03:58:48.538295: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library libcuda.so.1
2020-12-02 03:58:48.587523: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:982] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2020-12-02 03:58:48.587838: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1716] Found device 0 with properties:
pciBusID: 0000:01:00.0 name: GeForce GTX 1650 Ti computeCapability: 7.5
coreClock: 1.485GHz coreCount: 16 deviceMemorySize: 3.82GiB deviceMemoryBandwidth: 178.84GiB/s
2020-12-02 03:58:48.587860: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library libcudart.so.10.1
2020-12-02 03:58:48.589111: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library libcublas.so.10
2020-12-02 03:58:48.590284: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library libcufft.so.10
2020-12-02 03:58:48.590488: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library libcurand.so.10
2020-12-02 03:58:48.591785: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library libcusolver.so.10
2020-12-02 03:58:48.592520: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library libcusparse.so.10
2020-12-02 03:58:48.595129: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library libcudnn.so.7
2020-12-02 03:58:48.595213: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:982] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2020-12-02 03:58:48.595555: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:982] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2020-12-02 03:58:48.595815: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1858] Adding visible gpu devices: 0
[PhysicalDevice(name='/physical_device:GPU:0', device_type='GPU')]
I installed the nvidia-cuda-toolkit package:
$ sudo apt install nvidia-cuda-toolkit
and it worked.
I did not find the solution nor on the tensorflow website nor on the nvidia installation page. I found it by luck while looking for a way to get the cuda version with a command line: How to get the cuda version?
This didn't work for me, In my case it was because I had multiple versions of Cuda installed and that the cudnn version I had was for an older version than the one I was trying to use so I installed the cudnn for the new verision following nvidia's instructions and that did it for me.
I'm trying to install Quartus 13.0 on a docker container but I have a trouble with libpng12 lib.
builder#580847ded665:~$ ls -ld $(locate -r libpng.*\.so.*)
lrwxrwxrwx. 1 root root 18 Jan 6 2016 /lib/x86_64-linux-gnu/libpng12.so.0 -> libpng12.so.0.54.0
-rw-r--r--. 1 root root 149904 Jan 6 2016 /lib/x86_64-linux-gnu/libpng12.so.0.54.0
lrwxrwxrwx. 1 root root 35 Jan 6 2016 /usr/lib/x86_64-linux-gnu/libpng12.so.0 -> /lib/x86_64-linux-gnu/libpng12.so.0
builder#580847ded665:~$ xvfb-run -a /home/builder/altera/13.0/quartus/bin/tb2_install --enable
tb2_install: error while loading shared libraries: libpng12.so.0: cannot open shared object file: wrong ELF class: ELFCLASS64
The problem is I have a 32 bit application trying to use a 64 bit library and it is not understanding it. Could anyone please help me to figure out how to fix this issue?
Here's what you can do.
Download libpng12-0 package from
here.
Now head over to the folder where you've downloaded it and open the terminal from there. Switch to super user using:
sudo su
Install the downloaded package with the following command:
dpkg -i libpng12-0_1.2.50-1ubuntu2.14.04.3_amd64.deb; apt-get install -f
(The package name can change, make sure to change it accordingly).
If you get an error like this:
dpkg: error processing archive libpng12-0_1.2.50-1ubuntu2.14.04.3_amd64.deb (--install): trying to overwrite shared '/usr/share/doc/libpng12-0/changelog.Debian.gz'
This means that you might have an existing libpng package installed on your system which is causing a conflict.
Do this:
mv /usr/share/doc/libpng12-0 /usr/share/doc/libpng12-0.backup
This means that you are moving the conflict causing directory to another location.
Finally,
dpkg -i libpng12-0_1.2.50-1ubuntu2.14.04.3_amd64.deb; apt-get install -f
My answer is specific to Bionic beaver and *64 architecture. You can checkout the link provided above to download other architecture-specific packages.
Hope this helps!
Try installing 32-bit version of libpng. On Debian it should be something like apt-get install libpng16-16:i386. If tb2_install keeps picking 64-bit version you might need to update LD_LIBRARY_PATH to put 32-bit paths in front of 64-bit ones.
Another solution is to use 64-bit Quartus installer.
I met this error when compiling a modified caffe version.
OpenCV static library was compiled with CUDA 7.5 support. Please, use the same version or rebuild OpenCV with CUDA 8.0
I have some old code may not compatible with CUDA8.0, so I want to change my cuda version for this error.
I modified my ~/.bash_profile like this
# export PYTHONPATH=$PYTHONPATH:/usr/local/cuda-8.0/lib64/
# export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-8.0/lib64
export PYTHONPATH=$PYTHONPATH:/usr/local/cuda-7.5/targets/x86_64-linux/lib/
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-7.5/targets/x86_64-linux/lib/
But it did't work. Still the same error. What should I do? Thanks.
Change your CUDA soft link to point on your desired CUDA version. For example:
ll /usr/local/cuda
lrwxrwxrwx 1 root root 19 Sep 06 2017 /usr/local/cuda -> /usr/local/cuda-8.0/
Simply relink it with
Update:
If the symlink already exists, use this other command:
[jalal#goku ~]$ ls /usr/local/cuda
lrwxrwxrwx. 1 root root 20 Sep 14 08:03 /usr/local/cuda -> /usr/local/cuda-10.2
[jalal#goku ~]$ sudo ln -sfT /usr/local/cuda/cuda-11.1/ /usr/local/cuda
[jalal#goku ~]$ ls /usr/local/cuda
lrwxrwxrwx. 1 root root 26 Sep 14 13:25 /usr/local/cuda -> /usr/local/cuda/cuda-11.1/
ln -s /usr/local/cuda-7.5 /usr/local/cuda
(With the proper installation location)
Perhaps cleaner:
sudo update-alternatives --display cuda
sudo update-alternatives --config cuda
Maybe a bit late, but I thought it might still be helpful for anyone who comes across this question. I wrote a simple bash script for switching to a different version of CUDA within the current bash session: https://github.com/phohenecker/switch-cuda
This solution explains how you can have multiple different cuda versions installed, i.e. 10.2, 11.3 and 11.6 and switch between them. It's an extension of #w.t and makes use of update-alternatives.
Afaik, after cuda 11.x the installations on Ubuntu 20.04 cuda installations will be added to the update-alternatives maintenance automatically.
Let's say you installed cuda 10.2, cuda 11.3 and cuda 11.6 (following the official nvidia installation guide: https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html). They will all reside in:
/usr/local/cuda-10.2/...
/usr/local/cuda-11.3/...
/usr/local/cuda-11.6/...
Your update-alternatives will have two entries:
$ sudo update-alternatives --query cuda
...
/usr/local/cuda-11-3 - priority 113
/usr/local/cuda-11-6 - priority 116
Solution 1: If you want to make use of the update-alternatives make sure that your cuda symbolic link points to /etc/alternatives/cuda.
# Change the symbolic link target.
$ sudo ln -sfT /etc/alternatives/cuda /usr/local/cuda
# Check the path.
$ ll /usr/local/cuda
lrwxrwrwrwx 1 root root /usr/local/cuda -> /etc/alternatives/cuda/
Now, all that is left is to make sure /etc/alternatives/cuda points to the version you want to use, e.g. 11.3.
You can make that update with:
$ sudo update-alternatives --config cuda
and follow the instructions to change the version.
Check the path:
$ ll /etc/alternatives/cuda
lrwrwrwrwx root root /etc/alternatives -> /usr/local/cuda-11.3
almost done.
And always make sure to load the correct library PATHs in your ~/.bashrc.
Solution 2:
Directly set your /usr/local/cuda symbolic link to the correct version.
$ ln -sfT /usr/local/cuda-11.3 /usr/local/cuda
Reboot your machine and double check everything is set properly:
$ nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2021 NVIDIA Corporation
Built on Mon_May3 19:15:14_PDT_2021
Cuda compilation tools, release 11.3 V11.3.109
Build cuda 11.3.r11.3/compiler.29920130_0
I solved the problem finally.
Modifying ~/.bash_profile to change the path to CUDA is the correct way. But when you changed the file, you need to relaunch the bash.
Simply source ~/.bash_profile won't work. Because source will only append the content in the file to the already existed path rather than cover it.
I switched from cuda 10.2 to 11.7. export PATH=/etc/alternatives/cuda/bin:$PATH did the trick for me. I found the solution in this thread: https://stackoverflow.com/a/40599478/7924573
My machine: Linux RHEL 5.5.56 (64-bit), Perl 5.8.8. Postgres is not on this machine. But I can ping the Postgres machine no problem. And my machine can obviously install Perl modules from CPAN on the internet.
'uname -a' returns: Linux xxx 2.6.18-371.8.1.el5PAE #1 SMP Fri Mar 28 06:00:03 EDT 2014 i686 i686 i386 GNU/Linux
Other machine has Postgres 8.4.
I'm new to installing and using any DBI module. Detailed beginner instructions are needed.
I have root access to my Linux machine.
I think yum reports that I have 'postgresql-libs.i386' installed. `yum install | grep postgres` returns: 'postgresql-libs.i386 8.1.23-10.el5_10 installed'
Is this what I need? This is on my system.
lrwxrwxrwx 1 root root 12 May 1 20:05 /usr/lib/libpq.so.4 -> libpq.so.4.1*
-rwxr-xr-x 1 root root 130K Feb 27 07:36 /usr/lib/libpq.so.4.1*
Goal: I want to grab data from a Postgres server on another machine. I already have a db username, password, IP for the db machine.
Using cpanm I installed DBI just fine, no errors. When I installed DBD::Pg I got an error. CPAN error log follows:
cpanm (App::cpanminus) 1.6941 on perl 5.008008 built for i386-linux-thread-multi
Work directory is /root/.cpanm/work/1405531191.27414
You have make /usr/bin/make
You have LWP 6.04
You have /bin/tar: tar (GNU tar) 1.15.1
You have /usr/bin/unzip
Searching DBD::Pg on cpanmetadb ...
--> Working on DBD::Pg
Fetching http://www.cpan.org/authors/id/T/TU/TURNSTEP/DBD-Pg-3.3.0.tar.gz
-> OK
Unpacking DBD-Pg-3.3.0.tar.gz
Entering DBD-Pg-3.3.0
Checking configure dependencies from META.yml
Checking if you have version 0 ... Yes (0.88)
Checking if you have DBI 1.614 ... Yes (1.631)
Configuring DBD-Pg-3.3.0
Running Makefile.PL
Path to pg_config?
No POSTGRES_HOME defined, cannot find automatically
Configuring DBD::Pg 3.3.0
-> N/A
-> FAIL Configure failed for DBD-Pg-3.3.0. See /root/.cpanm/work/1405531191.27414/build.log for details.
Is it even possible for me to get data from the Postgres db on another machine?
Does anyone have a link to instructions on how to do this? I've already been googling stuff, reading stuff on CPAN, Stackoverflow and Perlmonks with no results.
FAQ at http://dbi.tiddlyspot.com/ has no info specific to installing DBD::Pg.
If I install Postgres via yum, will the installation overwrite any files, like libraries? If so, which ones? We do have other applications we use on this machine.
If I get this working, my first step is to show just very basic info about the DBI driver. Next step would be to show a few fields from one table in a SELECT statement.
I won't be returning millions of records, but returning 100 records is certainly in the ballpark.
Thank you!
If you use the package that is already built and available for your system, then you won't have any of these problems.
$ sudo yum install perl-DBD-Pg
... Lots of output snipped ...
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
perl-DBD-Pg x86_64 1.49-4.el5_8 centos-update 115 k
Installing for dependencies:
postgresql-libs x86_64 8.1.23-6.el5_8 centos-update 197 k
Transaction Summary
================================================================================
Install 2 Package(s)
Upgrade 0 Package(s)
Total download size: 312 k
Is this ok [y/N]:
My example uses Centos 5.8.8, but it should work just the same for RHEL.
Of course you can; it's a client/server architecture, after all!
The error in your log is due to a missing libpq5.