Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Wed 26 Nov 2014, 13:48
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
How to do native 64bit C programming??
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 1 of 1 Posts_count  
Author Message
SeanVN

Joined: 25 Mar 2014
Posts: 8

PostPosted: Tue 25 Mar 2014, 19:22    Post_subject:  How to do native 64bit C programming??  

I would like to write some native 64bit C and maybe assembler code together with using SDL. Well it is not going smoothly. I am trying with Geany and the devx_precise_5.7.1.sfs
It seems there is only a 32bit standard C library in there? Is that why I get errors when I use the -m64 and -march option.
Anyway how should I set things up and avoid wasting time. I do want to be able to use native 64bit operations to speed up random number generator algorithms etc.
Anyway, hello group.

gcc -Wall -c -m64 "SDLTest.c" (in directory: /root/my-documents)
In file included from /usr/include/SDL/SDL_main.h:26:0,
from /usr/include/SDL/SDL.h:30,
from SDLTest.c:2:
/usr/include/SDL/SDL_stdinc.h:34:23: fatal error: sys/types.h: No such file or directory
compilation terminated.
Compilation failed.
Back to top
View user's profile Send_private_message 
Flash
Official Dog Handler


Joined: 04 May 2005
Posts: 11164
Location: Arizona USA

PostPosted: Tue 25 Mar 2014, 22:56    Post_subject:  

Pardon my ignorance, but what do you mean by "native?"
Back to top
View user's profile Send_private_message 
SeanVN

Joined: 25 Mar 2014
Posts: 8

PostPosted: Tue 25 Mar 2014, 23:49    Post_subject:  

I mean you can add 2 64bit numbers in one machine instruction rather than with an with a 32bit add followed with a 32bit add with carry. Also for doing like an xor shift random number generator you can do a 64bit barrel shift in one machine instruction, the number of 32bit instructions needed to do that is an embarrassment.
Generally you also get more registers, avoiding the extreme register pressure you get with 32bit x86.
I guess I was trying to say I wanted to use the full x686 instruction set.
Together with some basic keyboard code and graphics in the SDL library. I downloaded the developer 64bit rpm from the SDL website and that installed without any problem (as far as I can see) on puppy Linux. I tried lubuntu but I backed away from its earnest efforts to wipe my hard drive during install.

-Version-
Kernel : Linux 3.9.11 (i686)
Version : #1 SMP Sat Jul 27 19:40:54 GMT-8 2013
C Library : GNU C Library version 2.15 (stable)
Distribution : Precise Puppy - 5.7.1
-Current Session-
Computer Name : puppypc29265
User Name : root (root)
Home Directory : /root
Desktop Environment : Unknown (Window Manager: JWM)
-Misc-
Uptime : 30 minutes
Load Average : 0.38, 0.33, 0.26

-Scripting Languages-
CPython : 2.7.3
Perl : 5.14.2
PHP : Not found
Ruby : Not found
Bash : 4.1.0(1)-release
-Compilers-
C (GCC) : 4.6.3
Java : Not found
CSharp (Mono, old) : Not found
CSharp (Mono) : Not found
Vala : Not found
Haskell (GHC) : Not found
FreePascal : Not found
-Tools-
make : 3.81
GDB : 7.4-2012.04-0ubuntu2.1)
strace : 4.5.20
valgrind : Not found
QMake : Not found
Back to top
View user's profile Send_private_message 
jamesbond

Joined: 26 Feb 2007
Posts: 2230
Location: The Blue Marble

PostPosted: Wed 26 Mar 2014, 04:06    Post_subject:  

Native 64bit programming requires native 64bit operating system (unless you're prepared to use a cross-compiler). Precise 5.7.1 is a 32-bit operating system and it *cannot* compile 64-bit binaries.

Your first step is to use 64-bit Linux - there are a few to choose: Fatdog64, Lighthouse64, Slacko64, and there may be others that I don't know ...

_________________
Fatdog64, Slacko and Puppeee user. Puppy user since 2.13.
Contributed Fatdog64 packages thread
Back to top
View user's profile Send_private_message 
SeanVN

Joined: 25 Mar 2014
Posts: 8

PostPosted: Wed 26 Mar 2014, 04:26    Post_subject:  

Well that would explain the problem right enough. Don't know why the OS is marked x686. I kinda want to do code for ARM mini-PCs as well so there is an argument to stick to 32bit. All ARM really need do is add a few 64bit integer registers for memory addressing to claim 64bit status. That is enough, if you ask me.
Thanks for the information, I will have a think about my optimal option.
Back to top
View user's profile Send_private_message 
SeanVN

Joined: 25 Mar 2014
Posts: 8

PostPosted: Wed 26 Mar 2014, 07:42    Post_subject:  

Ok, I put Fatdog64 on my computer and the devx.sfs file. I don't like to download so many 100's of megabytes but I'll do it one time out of curiosity. I compiled and linked a helloworld in the my-documents folder. I get an executable but Geany can't run it:
could not find /usr/bin/xterm

Must I build the executable in a different place or what do I change the terminal command to?
Also the SDL.rpm does not install, unlike with puppy linux. However I see there is a slightly older SDL pet that should install I hope.
I presume the Fatdog64 distribution is so far out there I will have a reduced risk of virus and malware attacks? I'm looking for a justification for the size of the thing, I suppose. Maybe I could of tried Pelles C/Wine.
Back to top
View user's profile Send_private_message 
SeanVN

Joined: 25 Mar 2014
Posts: 8

PostPosted: Wed 26 Mar 2014, 08:54    Post_subject:  

I can get the helloworld executable to execute using the desktop terminal.
I still can't find the correct thing to type for the terminal preference in Geany.
I see there are already SDL headers and libraries on my system.
When I try to link to the library I get rebuffed.
I will try a little more but it is getting elusive, I feel I should have a trouble free browsing environment to use, though.
Back to top
View user's profile Send_private_message 
SeanVN

Joined: 25 Mar 2014
Posts: 8

PostPosted: Wed 26 Mar 2014, 22:12    Post_subject:  

I used my day off to try to get set up to do what I want to do. Linux does not bend, you must. I don't know why I must jump through hoops for an operating system or dance for a dollar at a bar for Linus Torvals. I will steal a little bit more time to try but I presume I am heading toward 32bit Pelles C/Windows.
Back to top
View user's profile Send_private_message 
SeanVN

Joined: 25 Mar 2014
Posts: 8

PostPosted: Thu 27 Mar 2014, 22:26    Post_subject:  

Yeh, that Fatdog64 doesn't work. I tried the vala ide and it simply disappeared completely at the end of the project wizard. As a last resort to do 64 bit programming with FatDog64 I tried Java. When I tried to launch the simple and reliable tide Java IDE I was rebuffed.
You should probably not try not to do so much, rather do a little very well. Maybe you should think about not releasing into the public domain and just use these things for yourself or whatever. I am not looking to be harsh, because that is my idea for myself too. I don't it is any harm just to do your own projects and then not share them. I think it is actually the right thing to do in most cases.
Back to top
View user's profile Send_private_message 
Display_posts:   Sort by:   
Page 1 of 1 Posts_count  
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » Off-Topic Area » Programming
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0600s ][ Queries: 11 (0.0042s) ][ GZIP on ]