LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-15-2010, 11:49 AM   #1
tony_lincon
LQ Newbie
 
Registered: Jun 2010
Posts: 7

Rep: Reputation: 0
prng library in linux?


Hi,

I am new to Linux. I am trying to compile one software written by one of my collaborators.

I unzipped this software under Linux(Launch NX session for Windows, this Linux runs under Windows OS but I tried to do everything under Linux without using Windows OS) and tried the following:

bash-3.2$ ./configure && make

The following info appeared:
...
checking whether make sets $(MAKE)... (cached) yes checking for ranlib... (cached) ranlib checking whether make sets $(MAKE)... (cached) yes checking for exp in -lm... yes checking for prng_new in -lprng... no
configure: error: prng library not found

Then I tried to compile the C file with main() directly using:

bash-3.2$ g++ -o executable.exe mainProgram.c

The following info appeared:

mainProgram.c:14:18: error: prng.h: No such file or directory
mainProgram.c:15:19: error: tools.h: No such file or directory ...

So I doubt whether I need to install prng library. I tried to tar prng-3.0.2.tar.gz, and lpng142 which is developer version,. But the same error appeared.

My question is, is there aynthing wrong with the Linux configuration? Why the compiler can not recognize the prng library I downloaded?
I dont wanna ask my collaborator about this question cause I think that this question is kinda basic and I dont wanna leave him bad impression.

Thank you.
Tony
 
Old 06-15-2010, 12:31 PM   #2
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
Quote:
Why the compiler can not recognize the prng library I downloaded?
You didn't put it in the right place. You didn't mention what distribution you are running, but it probably has the prng libraries and headers available. Just install libsprng2-dev or whatever it's called.
 
Old 06-15-2010, 12:55 PM   #3
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
http://statmath.wu.ac.at/software/prng/download.html
http://statmath.wu.ac.at/software/pr...g-3.0.2.tar.gz
> prng-3.0.2.tar.gz

prng-3.0.2 will provide $PREFIX/lib/libprng.a and $PREFIX/include/prng.h

..

tools.h
http://packages.debian.org/search?se...ywords=tools.h
libntl-dev ?
..
 
Old 06-15-2010, 03:58 PM   #4
tony_lincon
LQ Newbie
 
Registered: Jun 2010
Posts: 7

Original Poster
Rep: Reputation: 0
Thanks for the quick apply, I appreciate them.

I downloaded libsprng2-dev from http://sprng.cs.fsu.edu/, which is actually sprng library. But in my first message I got the info such as "configure: error: prng library not found". So this sprng library can not work. Sorry.

Before I wrote my first message , I downloaded already prng-3.0.2.tar.gz. I put the folder prng-3.0.2 in the same directory as configure file is. I ran :

bash-3.2$ ./configure && make

The same info appeared:
...
checking for prng_new in -lprng... no
configure: error: prng library not found

I redownloaded prng-3.0.2.tar.gz and tried the same command ./configure && make, but still, the same info appeared:

configure: error: prng library not found

I put the folder prng-3.0.2 in the same directory as the configure file. What command should I use to let the system know that prng library is already there?

Thank you.
Tony
 
Old 06-15-2010, 04:35 PM   #5
jackerybakery
LQ Newbie
 
Registered: Jun 2010
Distribution: Arch
Posts: 5

Rep: Reputation: 0
Once you have installed the library, you may need to set different environment variables.

Try:
LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH"
export LD_LIBRARY_PATH

or edit the path to wherever the prng library installs itself.

Or if the prng does not "make itself" then copy the directory into /usr/local/lib and do the same thing.
I've had a lot of troubles with linux not being able to find libraries in the past, and generally this has been the cause.

N.B. If this works it might be wise to edit the .bashrc of your account which should be in their home folder, putting in the LD_LIBRARY_PATH code as this will set the environment variable whenever you login.

Last edited by jackerybakery; 06-15-2010 at 04:39 PM.
 
Old 06-15-2010, 05:52 PM   #6
tony_lincon
LQ Newbie
 
Registered: Jun 2010
Posts: 7

Original Poster
Rep: Reputation: 0
I tried

LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH"
export LD_LIBRARY_PATH

and Linux can recognize these two commmands. but still, it can not find the h files.
I had to copy the the h files into the same directory as the C file and compile it.
and there is one error:

aaa.h:72: error: expected \u2018,\u2019 or \u2018...\u2019 before \u2018new\u2019

actually it should be : aaa.h:72: error: expected ',' or '...' before 'new'

I checked the line 72 of aaa.h:

int MoveNode(struct node_gra *node, struct group *old, struct group *new);

I can not find anything wrong!
what is the problem?

Thanks.
Tony
 
Old 06-16-2010, 12:53 AM   #7
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
cd prng-3.0.2/ && make
su
make install
.. will provide the files in /usr/local/
.. Without that, there is no reason to point to
/usr/local/ with export LD_LIBRARY_PATH , etc.
..

Last edited by knudfl; 06-16-2010 at 02:49 AM.
 
Old 06-16-2010, 08:56 AM   #8
tony_lincon
LQ Newbie
 
Registered: Jun 2010
Posts: 7

Original Poster
Rep: Reputation: 0
Thank you for all replies which are helpful. I appreciate a lot.
After I tried make install, the following appeared:

bash-3.2$ make install
Making install in gsl
make[1]: Entering directory `myDir/gsl-1.9/gsl'
make[2]: Entering directory `myDir/gsl-1.9/gsl'
make[2]: Nothing to be done for `install-exec-am'.
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `myDir/gsl-1.9/gsl'
make[1]: Leaving directory `myDir/gsl-1.9/gsl'
Making install in utils
make[1]: Entering directory `myDir/gsl-1.9/utils'
make[2]: Entering directory `myDir/gsl-1.9/utils'
make[2]: Nothing to be done for `install-exec-am'.
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `myDir/gsl-1.9/utils'
make[1]: Leaving directory `myDir/gsl-1.9/utils'
Making install in sys
make[1]: Entering directory `myDir/gsl-1.9/sys'
make[2]: Entering directory `myDir/gsl-1.9/sys'
make[2]: Nothing to be done for `install-exec-am'.
test -z "/usr/local/include/gsl" || mkdir -p -- "/usr/local/include/gsl"
mkdir: cannot create directory `/usr/local/include/gsl': Permission denied
make[2]: *** [install-pkgincludeHEADERS] Error 1
make[2]: Leaving directory `myDir/gsl-1.9/sys'
make[1]: *** [install-am] Error 2
make[1]: Leaving directory `myDir/gsl-1.9/sys'
make: *** [install-recursive] Error 1

This means that I did not install the library correctly?
Thanks.
Tony
 
Old 06-16-2010, 09:10 AM   #9
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
As requested by AlucardZero, please tell us what linux distribution you are running. Once you provide that information it should be trivial to answer your question.

However you state "Launch NX session for Windows", so I wonder if you are really running linux at all: perhaps you are using cygwin?

Evo2.
 
Old 06-16-2010, 11:10 AM   #10
tony_lincon
LQ Newbie
 
Registered: Jun 2010
Posts: 7

Original Poster
Rep: Reputation: 0
You are right. I should write more details about the Linux environment I am using:

Someone helped me and used centos5-wrkstn-flat.vmdk to install a virtual machine for linux on my Windows NP OS.
I am using GNOME desktop ver 2.16.0, from distributor Red Hat Inc, build date 09/04/2006.
The user interface for Linux starts from Nomachine.

Hopefully this info is detailed enough.
THank you.
Tony
 
Old 06-16-2010, 11:15 AM   #11
tony_lincon
LQ Newbie
 
Registered: Jun 2010
Posts: 7

Original Poster
Rep: Reputation: 0
One more piece of info: this Linux environment is CentOS 5.4 in a vmware virtual machine.
 
Old 06-16-2010, 03:30 PM   #12
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Ok, centos. Please try using your package manager: "yum". Read some documentation or tutorials on the web.

Evo2.
 
Old 06-17-2010, 02:25 AM   #13
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Post # 8
Quote:
Permission denied
... You will need a password to install to /usr//local.

The commands are 1) su
1a) Then enter your root password.
>> Entering a password in a terminal window is "invisible",
you won't see any types or dots, when you type.
2) <ENTER>
3) make install

.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
PRNG is not set while running sshd saurin Programming 1 10-10-2009 10:32 PM
LINUX - linking archive (static library) with shared (dynamic) library gurkama Programming 5 03-04-2007 11:11 PM
"PRNG is not seeded" error when starting OpenSSH server germanbird Slackware 5 01-12-2006 01:31 PM
error message "PRNG not seeded" steve@ez.net Linux - Security 3 01-01-2006 07:20 PM
about PRNG dummyagain Programming 0 10-25-2004 03:40 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:20 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration