LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-17-2017, 03:40 PM   #1
pedros
Member
 
Registered: May 2017
Posts: 85

Rep: Reputation: Disabled
How to run this debian example?


This is some example code in debian 8.5 software repository. How to run it?
Code:
atscc /usr/share/doc/ats-lang-anairiats-examples/examples/AUP/AUP_5_17_3.dats
/usr/lib/ats-anairiats-0.2.11/bin/atsopt --output AUP_5_17_3_dats.c --dynamic /usr/share/doc/ats-lang-anairiats-examples/examples/AUP/AUP_5_17_3.dats
gcc -I/usr/lib/ats-anairiats-0.2.11/ -I/usr/lib/ats-anairiats-0.2.11/ccomp/runtime/ -L/usr/lib/ats-anairiats-0.2.11/ccomp/lib64/ /usr/lib/ats-anairiats-0.2.11/ccomp/runtime/ats_prelude.c AUP_5_17_3_dats.c -lats
AUP_5_17_3_dats.c:58:30: error: ĎPTHREAD_MUTEX_INITIALIZERí undeclared here (not in a function)
static pthread_mutex_t mtx = PTHREAD_MUTEX_INITIALIZER ;
^
Exit: [gcc] failed.
 
Old 05-18-2017, 05:14 AM   #2
hunkemoller
LQ Newbie
 
Registered: Oct 2013
Distribution: ubuntu
Posts: 5

Rep: Reputation: Disabled
Pedros, you need to supply more information than just this, the error reported is clear in itself.

ps: i see your name and same question all over http://forums.debian.net/viewtopic.php?t=133008 .....
 
1 members found this post helpful.
Old 05-18-2017, 08:03 AM   #3
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 873Reputation: 873Reputation: 873Reputation: 873Reputation: 873Reputation: 873Reputation: 873
$ egrep -r -i pthread /usr/include/* | grep -i pthread_mutex_initializer
/usr/include/pthread.h:# define PTHREAD_MUTEX_INITIALIZER \
/usr/include/pthread.h:# define PTHREAD_MUTEX_INITIALIZER \
...

$ apt-file find usr/include/pthread.h
libc6-dev: /usr/include/pthread.h

$ sudo apt-get install libc6-dev
 
Old 05-18-2017, 08:13 AM   #4
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 873Reputation: 873Reputation: 873Reputation: 873Reputation: 873Reputation: 873Reputation: 873
Although if you're missing that most basic of things.

$ sudo apt-get install build-essential devscripts
 
Old 05-18-2017, 03:15 PM   #5
pedros
Member
 
Registered: May 2017
Posts: 85

Original Poster
Rep: Reputation: Disabled
to hunkemoller.
error: ‘PTHREAD_MUTEX_INITIALIZER’ undeclared here (not in a function)
It seems to me that PTHREAD_MUTEX_INITIALIZER needs to be declared somewhere. And since it was not declared in the example script, I guess the program
is looking for the declaration somewhere else. And I am assuming that since the script is included in the debian main software repository,
it should run? I found many example scripts that give error messages. I commented the scripts out in the bash file
http://pdscript.com/p/debian/example/bash/ats.txt
Would you like to see the error messages? And yes, I did post one of them twice at http://forums.debian.net/viewtopic.php?t=133008
It was ignored. You may help with that one if you wish. To avoid double-posting, I avoid asking about the same script twice.
I figure if I had the answer to some, then I could apply the answer to the rest.

to Shadow_7, Senior Member.
I tried to reproduce your work.
The file /mnt/01/dists/jessie/main/Contents-amd64.gz does not exist,
and so apt-file update gives an error. I installed everything you said to. Result is still the same.

to anyone.
To be less specific, In the bash file http://pdscript.com/p/debian/example/bash/ats.txt
can any of the commented-out scripts be run?
 
Old 05-18-2017, 07:24 PM   #6
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 873Reputation: 873Reputation: 873Reputation: 873Reputation: 873Reputation: 873Reputation: 873
/mnt/01/dists/jessie/main/Contents-amd64.gz

That's not a usual thing. What special voodoo are you doing? Cygwin under windows? VM? KVM? PXE? local mirror? CD-ROMs? ??? Not that it matters in this case for apt-file as we were "looking" for the missing bits. It's the install lines that matter in terms of end results.

Did it fail in the same place same error? You might need to override a lot of things with special voodoo. -I/path/to/stuff -L/path/to/things and various other gcc options depending on what you're trying to do. The blackmagic I had to do for povray on debian armel on a pi B from source was, well, educational. Be sure to follow the ./docs/ or README or INSTALL steps as much as they apply to your situation anyway. The usual configure make make install steps of old don't apply as much anymore.
 
Old 05-19-2017, 10:43 AM   #7
pedros
Member
 
Registered: May 2017
Posts: 85

Original Poster
Rep: Reputation: Disabled
I have 13 dvd set debian 8.5. I store it in /mnt.
See details in my post in Linux - General, Where is the best local place to store debian software repository?
http://www.linuxquestions.org/questi...84#post5712784
Anyway, I use standard install and default settings as much as possible. Minimal setup. I do not even use sudo.
I can try adjusting path. Note that my current settings work for many of the examples.
Has anyone got the commented-out examples working? how?
 
Old 05-19-2017, 11:59 AM   #8
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
Originally Posted by pedros View Post
And yes, I did post one of them twice at http://forums.debian.net/viewtopic.php?t=133008
It was ignored.
It most certainly was not ignored.

You were chided for "--allow-unauthenticated -y" and a senior member said your post "It has no business being on this forum."
and
Quote:
Originally Posted by pedros View Post
I use standard install and default settings as much as possible. Minimal setup.
and
Code:
--allow-unauthenticated -y
is a risk, far from "standard and default settings". You are deviating from safe and stable practices.
You should try default. it rocks.

I encourage free thinking, but there this "thing" called DontBreakDebian or FrankenDebian.
Voodoo? FrankenDebian.

Have you taken a gander through any other documents in /usr/share/doc/ats-lang-anairiats-examples/ ?

Code:
sudo apt-get install debian-handbook
and use your browser to File > Open > /usr/share/doc/debian-handbook/html/index.htm

See file:///usr/share/doc/debian-handbook/html/sect.setup-apt-package-repository.html or
https://debian-handbook.info/browse/...epository.html for repository tips.

What you may wish to run to verify the dpkg system is ok using
Code:
sudo apt-get install -f
and follow the prompts.

FWIW: I don't think you've installed build-essential if gcc is failing.

I show 3 distinct ats-lang-anairiats packages:
Code:
ats-lang-anairiats - Legacy ATS v1 language compiler, named Anairiats
ats-lang-anairiats-doc - Documentation for the ATS compiler Anairiats
ats-lang-anairiats-examples - Examples for the ATS compiler Anairiats
and you've only mentioned the /usr/share/doc/ats-lang-anairiats-examples/examples/AUP/AUP_5_17_3.dats file, so are there files in /usr/share/doc/ats-lang-anairiats-docs/ ?

Wow, what a project.
Code:
sudo aptitude install ats-lang-anairiats-docs
[sudo] password for toaster: 
The following NEW packages will be installed:
...
0 packages upgraded, 86 newly installed, 0 to remove and 0 not upgraded.

Good Luck.

Last edited by Habitual; 05-19-2017 at 12:04 PM.
 
1 members found this post helpful.
Old 05-19-2017, 03:19 PM   #9
pedros
Member
 
Registered: May 2017
Posts: 85

Original Poster
Rep: Reputation: Disabled
to Habitual, LQ Addict.

I should use sudo, and another install method?

It most certainly was not ignored. Thank you for clarifying this.
Running the script was ignored, but security was not ignored.
I was so intent in finding a way to run the script, that I overlooked security.
What other install method should I use?

/usr/share/doc/ats-lang-anairiats-examples/
has many scripts, not many documents.
AUP_5_17_3.dats says this.
Author: Hongwei Xi (hwxi AT cs DOT bu DOT edu)
book: AUP (2nd edition), pages 332 - 338
section 5.17.3: Thread Synchronization (Mutexes)
Author did not respond to my email. I do not have the book.
But my question is: how to run this script in debian?

I had hoped that my work could be run on a system easily installed and setup by a novice user.
And sudo is not installed by default. I know sudo, but the setup instructions
are more complicated than I wish for. But you say I should use sudo anyway.

file:///usr/share/doc/debian-handbook/html/sect.setup-apt-package-repository.html
says: virtual host on internal HTTP server, with /srv/vhosts/packages/
I suppose this answers my question of where to put repository. Thank you.
But with internet search I also found these suggestions.
/packages/ /var/www/debian/ /usr/local/packages/ /dists

I ran apt-get install -f. There were no prompts. Everything looked good.

ats-lang-anairiats-doc has a pdf file that tells how to program.
It says nothing about system configuration.

The project is mostly done. There are simply some rogue scripts that would not compile.
The project should be redone: adding reasons in the documentation.
adding sudo. changing install method. Do you agree?
 
Old 05-19-2017, 04:31 PM   #10
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 873Reputation: 873Reputation: 873Reputation: 873Reputation: 873Reputation: 873Reputation: 873
Quote:
Originally Posted by pedros View Post
I have 13 dvd set debian 8.5. I store it in /mnt.
See details in my post in Linux - General, Where is the best local place to store debian software repository?
http://www.linuxquestions.org/questi...84#post5712784
Anyway, I use standard install and default settings as much as possible. Minimal setup. I do not even use sudo.
I can try adjusting path. Note that my current settings work for many of the examples.
Has anyone got the commented-out examples working? how?
For optical images, I tend to mount them -o loop and copy the *.deb's to /var/cache/apt/archives/. That way it never prompts me to insert the disk. Once those exist and the package manager knows about the packages, I move the .iso's off system to save space. But I never purge the /var/cache/apt/archives/ path for existing systems. And I'd hardly call my methods standard, or even best practices. Plus the last time I did something like that the distro fit on 3 CDs or 1 DVD image. Which was an improvement over 26 floppy disks.
 
Old 05-19-2017, 04:46 PM   #11
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
Originally Posted by pedros View Post
I was so intent in finding a way to run the script, that I overlooked security.
+1
Quote:
Originally Posted by pedros View Post
What other install method should I use?
To install what? From where? We've established it will have to be run as root.

Quote:
Originally Posted by pedros View Post
But my question is: how to run this script in debian?
What "script"?
Code:
atscc /usr/share/doc/ats-lang-anairiats-examples/examples/AUP/AUP_5_17_3.dats
is not a script.

How did the package ats-lang-anairiats get installed?
From where?
When I examined some /usr/share/doc/ats-lang-anairiats-examples/examples/AUP/ file in a .deb I saw only what I guess is gcc code.


Quote:
Originally Posted by pedros View Post
file:///usr/share/doc/debian-handbook/html/sect.setup-apt-package-repository.html
says: virtual host on internal HTTP server, with /srv/vhosts/packages/
I suppose this answers my question of where to put repository. Thank you.
But with internet search I also found these suggestions.
/packages/ /var/www/debian/ /usr/local/packages/ /dists
You're welcome. Yes, Debian is quite flexible. There are many ways.

That's good. Get a perspective on how other folks have solved the same problem But since you are a novice and overlooked security,
I recommend you start with "The Debian Way". And start documenting this stuff.

Quote:
Originally Posted by pedros View Post
I ran apt-get install -f. There were no prompts. Everything looked good.
Great! I had my doubts. That's always a good sign!

You keep mentioning "this script"
If "this script" is
Code:
atscc /usr/share/doc/ats-lang-anairiats-examples/examples/AUP/AUP_5_17_3.dats
Then run this:
Code:
apt-get install ats-lang-anairiats ats-lang-anairiats-doc
There's a huge list following
this package around. Take a breath. Yes, all those. Take another breath.

since you already have one of 3 packages already, (ats-lang-anairiats-examples), I omitted it from the above.
After that install, open a terminal and issue
Code:
atscc /usr/share/doc/ats-lang-anairiats-examples/examples/AUP/AUP_5_17_3.dats
and see what's what.

Please take some time to have a look at the section titled
### Debian ###

Hope I didn't come off as a jerk.

Good Luck!

Last edited by Habitual; 05-19-2017 at 04:49 PM.
 
Old 05-20-2017, 05:32 PM   #12
pedros
Member
 
Registered: May 2017
Posts: 85

Original Poster
Rep: Reputation: Disabled
I now understand there is no standard or official local place to store debian software repository. Diffrent people use diffrent locations. I use /mnt.

I installed sudo, and added this to /etc/sudoers.
Code:
Defaults !authenticate
root ALL=(ALL) ALL
d ALL=(ALL) ALL
%sudo ALL=(ALL) ALL
I removed packages ats-lang-anairiats ats-lang-anairiats-examples. I ran this.
Code:
sudo apt-get install ats-lang-anairiats ats-lang-anairiats-examples;
prompt says Install these packages without verification? [y/N]
I would like everything to be automatic, without prompting. Is there a way to do this that is accepted by the community, or should I abandon this idea of being automatic ?

In the bash file http://pdscript.com/p/debian/example/bash/ats.txt many files are listed. They are from the package ats-lang-anairiats-examples. I call these files scripts, but a better term might be code? Some of the lines begin with #. This means the line is commented-out. These commented-out lines have files that will not compile. Perhaps some of them are some sort of template and are not meant to compile as is. Perhaps some of them requre special system setup to compile. I would like to know which.
 
Old 05-20-2017, 10:16 PM   #13
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 873Reputation: 873Reputation: 873Reputation: 873Reputation: 873Reputation: 873Reputation: 873
$ man apt-get

There's -y --yes --assume-yes that prevents the verification pause. You could also install the keyring stuffs so verification is not something that would be prompting you. And if you have all the packages that it might grab, it'll just do it, and not prompt you when not using the -y option. Otherwise use -y.

Code:
sudo apt-get -y install ats-lang-anairiats ats-lang-anairiats-examples
You don't need the ; at the end unless you're stringing another command on the same line or adding a # comment. Not that it hurts anything, it's just an extra key stroke that'll be ignored.

ats seems interesting, although I'm not much for languages who's compiler is written in the same language (beyond C anyway). There's too much of a chicken or an egg scenario. Plus lots of things make the claim, can be as efficient as C/C++, like RPerl. Outside of a job, is there a reason to learn ATS over say ADA that actually gets used (probably only by the governments).
 
Old 05-21-2017, 02:26 AM   #14
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 17,401
Blog Entries: 10

Rep: Reputation: 5213Reputation: 5213Reputation: 5213Reputation: 5213Reputation: 5213Reputation: 5213Reputation: 5213Reputation: 5213Reputation: 5213Reputation: 5213Reputation: 5213
you are running a server/website and are active on at least 2 forums - so you do have internet connectivity.
this offline repo, is it on a different machine? one that is not connected to the internet?
 
Old 05-21-2017, 04:34 AM   #15
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
Originally Posted by pedros View Post
I abandon this idea of being automatic?
Again, what are you trying to automate?

Code:
apt-get -yqq install ats-lang-anairiats ats-lang-anairiats-examples
is what I'd use.
It one of the quickest method.
See man apt-get for more on these ("-y, -q") switches, including your use of (and why?)
Code:
--allow-unauthenticated
           Ignore if packages can't be authenticated and don't prompt about it. This is useful for tools like pbuilder. Configuration Item:
           APT::Get::AllowUnauthenticated.
pbuilder is a repo? If it is, you'd only need
--allow-unauthenticated -y for their stuff, I presume.

Installing sudo is good for experience, but it is not required for this to work.
I have an Debian8.7 installing in Vbox now to see what's what with
Code:
atscc /usr/share/doc/ats-lang-anairiats-examples/examples/AUP/AUP_5_17_3.dats
I'll let you know how that goes later today.
Good Luck.

Last edited by Habitual; 05-21-2017 at 04:46 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
How to run MS windows s/w on Debian joboy Debian 3 06-10-2016 01:37 AM
LXer: If you run Linux, you can run Debian. At least give it a try LXer Syndicated Linux News 0 03-09-2013 09:01 PM
Debian daily cron job won't run, but does run in cron.hourly. sandersch Linux - General 7 05-24-2012 01:50 AM
Trying to run Nagios on Debian 4 andybrr Linux - Networking 2 04-04-2008 01:02 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:43 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