Hey Guys,

I am (still) having problems to set up the PrizmSDK on Linux Mint. I follow this tutorial: https://prizm.cemetech.net/index.php?title=PrizmSDK_Setup_Guide.

The end and the next post ( https://prizm.cemetech.net/index.php?title=Hello_World) says to go into the PrizmSDK Directory. The thing is, I do not understand what that should be. I have the four directories (binutils, build-binutils, build-gcc, gcc) in usr/src/, and mkg3a in home/Development/Prizm.

I am a bit lost and have no idea which one is the PrizmSDK Directory. I believe is none of them, since I couln't find the toolchain/ folder mentioned in the PrizmSDK Setup Guide.

Thanks!
Whoever wrote that didn't make it very clear; you need the libraries, makefiles and whatnot from libfxcg. Since you don't care for the compiler and other tools that are provided in the prebuilt windows binary package, you're probably best off checking out a copy and replicating what the build process does yourself. The alternate option is to download the windows SDK package and delete or otherwise ignore the tool binaries it includes.
If I'd pick the second option, how would I build it then? The makefile only refers to the windows compiler, which doesn't work for me.
Which makefile are you referring to? There's nothing in any that I'm aware of which won't work on a correctly-configured non-Windows system.
Yeah I just realized I meant the make.bat since i cant use that what would i use instead to build the project? I cant find that

Edit: The make.bat in the project folder
Simply run make. The provided batch file is simply a convenience for users who don't have make on PATH; it contains only one line:

Code:
..\..\bin\make.exe %*

Code:

laslo@MyTreasure-LinuxMint:~/Development/Prizm/PrizmSDK-win-0.5.2/projects/example$ make
sh3eb-elf-gcc -MMD -MP -MF /home/laslo/Development/Prizm/PrizmSDK-win-0.5.2/projects/example/build/example.d -Os -Wall -mb -m4a-nofpu -mhitachi -nostdlib   -I/home/laslo/Development/Prizm/PrizmSDK-win-0.5.2/projects/example/build -I/home/laslo/Development/Prizm/PrizmSDK-win-0.5.2/include -ffunction-sections -fdata-sections -c /home/laslo/Development/Prizm/PrizmSDK-win-0.5.2/projects/example/src/example.c -o example.o
make[1]: execvp: sh3eb-elf-gcc: Not a directory
make[1]: *** [/home/laslo/Development/Prizm/PrizmSDK-win-0.5.2/toolchain/prizm_rules:64: example.o] Error 127
make: *** [Makefile:108: all] Error 2


Right now I am considering to switch to Windows since I have dual boot on this machine. Would you recommend doing that or is there a medium-difficult solution to my problems? Smile
It looks like you didn't follow the final "Configuring things" step on the page you linked initially. Your compiler and other tools either need to be on PATH or all in a directory that you point PREFIX to in the makefile.
Lasslos wrote:

Code:

laslo@MyTreasure-LinuxMint:~/Development/Prizm/PrizmSDK-win-0.5.2/projects/example$ make
sh3eb-elf-gcc -MMD -MP -MF /home/laslo/Development/Prizm/PrizmSDK-win-0.5.2/projects/example/build/example.d -Os -Wall -mb -m4a-nofpu -mhitachi -nostdlib   -I/home/laslo/Development/Prizm/PrizmSDK-win-0.5.2/projects/example/build -I/home/laslo/Development/Prizm/PrizmSDK-win-0.5.2/include -ffunction-sections -fdata-sections -c /home/laslo/Development/Prizm/PrizmSDK-win-0.5.2/projects/example/src/example.c -o example.o
make[1]: execvp: sh3eb-elf-gcc: Not a directory
make[1]: *** [/home/laslo/Development/Prizm/PrizmSDK-win-0.5.2/toolchain/prizm_rules:64: example.o] Error 127
make: *** [Makefile:108: all] Error 2


Right now I am considering to switch to Windows since I have dual boot on this machine. Would you recommend doing that or is there a medium-difficult solution to my problems? Smile

Personally, after the inital setup I found the Windows version more confusing.
That's just personal preference though.

I've also went and edited the section you were confused about in the setup guide to make it clearer.
First of all, thanks for being so patient with beginners like me Smile. Here are a few points:


    Am I right that the projects/example folder is only contained in the windows release? Wouldn't be a problem for me, I can just copy it, but that will be confusing for anyone new.

    When running make in the examples directory copied to the PrizmSDK Github clone, I get this error:

    Code:

    laslo@MyTreasure-LinuxMint:~/Development/Prizm/libfxcg/projects/example$ make
    /usr/local/cross/bin/sh3eb-elf-gcc -MMD -MP -MF /home/laslo/Development/Prizm/libfxcg/projects/example/build/example.d -Os -Wall -mb -m4a-nofpu -mhitachi -nostdlib   -I/home/laslo/Development/Prizm/libfxcg/projects/example/build -I/home/laslo/Development/Prizm/libfxcg/include -ffunction-sections -fdata-sections -c /home/laslo/Development/Prizm/libfxcg/projects/example/src/example.c -o example.o
    make[1]: /usr/local/cross/bin/sh3eb-elf-gcc: Command not found
    make[1]: *** [/home/laslo/Development/Prizm/libfxcg/toolchain/prizm_rules:64: example.o] Error 127
    make: *** [Makefile:108: all] Error 2


    The error message is right, there is no such file in that directory

    Code:

    laslo@MyTreasure-LinuxMint:/usr/local/cross/bin$ ls
    sh3eb-elf-addr2line  sh3eb-elf-elfedit  sh3eb-elf-nm       sh3eb-elf-readelf
    sh3eb-elf-ar         sh3eb-elf-gprof    sh3eb-elf-objcopy  sh3eb-elf-size
    sh3eb-elf-as         sh3eb-elf-ld       sh3eb-elf-objdump  sh3eb-elf-strings
    sh3eb-elf-c++filt    sh3eb-elf-ld.bfd   sh3eb-elf-ranlib   sh3eb-elf-strip


    I did look up where my cross-compiler toolchain is and edited the PREFIX in prizm_rules accordingly:

    Code:

    ifeq ($(strip $(FXCGSDK)),)
    $(error "Please set FXCGSDK in your environment. export FXCGSDK=<path to sdk location>)
    endif

    export   LIBFXCG_INC   :=   $(FXCGSDK)/include
    export   LIBFXCG_LIB   :=   $(FXCGSDK)/lib

    MACHDEP = -mb -m4a-nofpu -mhitachi -nostdlib

    #---------------------------------------------------------------------------------
    # path to tools
    #---------------------------------------------------------------------------------
    export PATH   :=   $(FXCGSDK)/bin:$(PATH)

    #---------------------------------------------------------------------------------
    # the prefix on the compiler executables
    #---------------------------------------------------------------------------------
    PREFIX := /usr/local/cross/bin/sh3eb-elf-

    export AS   :=   $(PREFIX)as
    export CC   :=   $(PREFIX)gcc
    export CXX   :=   $(PREFIX)g++
    export AR   :=   $(PREFIX)gcc-ar
    export OBJCOPY   :=   $(PREFIX)objcopy
    export MKG3A := mkg3a

    ifeq ($(OS),Windows_NT)
    define rm
      del /S /Q $(foreach deleteFile,$(1),$(subst /,\,$(deleteFile)))
    endef
    define rmdir
      rmdir /S /Q $(foreach deleteDir,$(1),$(subst /,\,$(deleteDir)))
    endef
    else
    define rm
      rm -f "$(1)"
    endef
    define rmdir
      rm -rf "$(1)"
    endef
    endif

    #---------------------------------------------------------------------------------
    # This is from devkitpro's MSVC stuff for makings errors cleaner, requires sed
    #---------------------------------------------------------------------------------
    #ISVC=$(or $(VCBUILDHELPER_COMMAND),$(MSBUILDEXTENSIONSPATH32),$(MSBUILDEXTENSIONSPATH))
    #
    #ifneq (,$(ISVC))
    #   ERROR_FILTER   :=   2>&1 | sed -e 's/\(.[a-zA-Z]\+\):\([0-9]\+\):/\1(\2):/g'
    #endif

    #---------------------------------------------------------------------------------
    %.a:
    #---------------------------------------------------------------------------------
       $(call rm,$@)
       $(AR) -rc $@ $^

    #---------------------------------------------------------------------------------
    %.o: %.cpp
       $(CXX) -MMD -MP -MF $(DEPSDIR)/$*.d $(CXXFLAGS) -c $< -o $@ $(ERROR_FILTER)
       
    #---------------------------------------------------------------------------------
    %.o: %.c
       $(CC) -MMD -MP -MF $(DEPSDIR)/$*.d $(CFLAGS) -c $< -o $@ $(ERROR_FILTER)

    #---------------------------------------------------------------------------------
    %.o: %.m
       $(CC) -MMD -MP -MF $(DEPSDIR)/$*.d $(OBJCFLAGS) -c $< -o $@ $(ERROR_FILTER)

    #---------------------------------------------------------------------------------
    %.o: %.s
       $(CC) -MMD -MP -MF $(DEPSDIR)/$*.d -x assembler-with-cpp $(ASFLAGS) -c $< -o $@ $(ERROR_FILTER)

    #---------------------------------------------------------------------------------
    %.o: %.S
       $(CC) -MMD -MP -MF $(DEPSDIR)/$*.d -x assembler-with-cpp $(ASFLAGS) -c $< -o $@ $(ERROR_FILTER)
       
    #---------------------------------------------------------------------------------
    %.g3a: %.bin
       $(MKG3A) $(MKG3AFLAGS) $< $@
       
    %.bin:
       $(LD)  $^ $(LDFLAGS) $(LIBPATHS) $(LIBS) -o $@

    #---------------------------------------------------------------------------------
    # canned command sequence for binary data
    #---------------------------------------------------------------------------------
    define bin2o
       bin2s -a 32 $< | $(AS) -o $(@)
       echo "extern const u8" `(echo $(<F) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`"_end[];" > `(echo $(<F) | tr . _)`.h
       echo "extern const u8" `(echo $(<F) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`"[];" >> `(echo $(<F) | tr . _)`.h
       echo "extern const u32" `(echo $(<F) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`_size";" >> `(echo $(<F) | tr . _)`.h
    endef




I really hope that we can figure it out!
Lasslos wrote:
First of all, thanks for being so patient with beginners like me Smile. Here are a few points:


    Am I right that the projects/example folder is only contained in the windows release? Wouldn't be a problem for me, I can just copy it, but that will be confusing for anyone new.

    When running make in the examples directory copied to the PrizmSDK Github clone, I get this error:

    Code:

    laslo@MyTreasure-LinuxMint:~/Development/Prizm/libfxcg/projects/example$ make
    /usr/local/cross/bin/sh3eb-elf-gcc -MMD -MP -MF /home/laslo/Development/Prizm/libfxcg/projects/example/build/example.d -Os -Wall -mb -m4a-nofpu -mhitachi -nostdlib   -I/home/laslo/Development/Prizm/libfxcg/projects/example/build -I/home/laslo/Development/Prizm/libfxcg/include -ffunction-sections -fdata-sections -c /home/laslo/Development/Prizm/libfxcg/projects/example/src/example.c -o example.o
    make[1]: /usr/local/cross/bin/sh3eb-elf-gcc: Command not found
    make[1]: *** [/home/laslo/Development/Prizm/libfxcg/toolchain/prizm_rules:64: example.o] Error 127
    make: *** [Makefile:108: all] Error 2


    The error message is right, there is no such file in that directory

    Code:

    laslo@MyTreasure-LinuxMint:/usr/local/cross/bin$ ls
    sh3eb-elf-addr2line  sh3eb-elf-elfedit  sh3eb-elf-nm       sh3eb-elf-readelf
    sh3eb-elf-ar         sh3eb-elf-gprof    sh3eb-elf-objcopy  sh3eb-elf-size
    sh3eb-elf-as         sh3eb-elf-ld       sh3eb-elf-objdump  sh3eb-elf-strings
    sh3eb-elf-c++filt    sh3eb-elf-ld.bfd   sh3eb-elf-ranlib   sh3eb-elf-strip


    I did look up where my cross-compiler toolchain is and edited the PREFIX in prizm_rules accordingly:

    Code:

    ifeq ($(strip $(FXCGSDK)),)
    $(error "Please set FXCGSDK in your environment. export FXCGSDK=<path to sdk location>)
    endif

    export   LIBFXCG_INC   :=   $(FXCGSDK)/include
    export   LIBFXCG_LIB   :=   $(FXCGSDK)/lib

    MACHDEP = -mb -m4a-nofpu -mhitachi -nostdlib

    #---------------------------------------------------------------------------------
    # path to tools
    #---------------------------------------------------------------------------------
    export PATH   :=   $(FXCGSDK)/bin:$(PATH)

    #---------------------------------------------------------------------------------
    # the prefix on the compiler executables
    #---------------------------------------------------------------------------------
    PREFIX := /usr/local/cross/bin/sh3eb-elf-

    export AS   :=   $(PREFIX)as
    export CC   :=   $(PREFIX)gcc
    export CXX   :=   $(PREFIX)g++
    export AR   :=   $(PREFIX)gcc-ar
    export OBJCOPY   :=   $(PREFIX)objcopy
    export MKG3A := mkg3a

    ifeq ($(OS),Windows_NT)
    define rm
      del /S /Q $(foreach deleteFile,$(1),$(subst /,\,$(deleteFile)))
    endef
    define rmdir
      rmdir /S /Q $(foreach deleteDir,$(1),$(subst /,\,$(deleteDir)))
    endef
    else
    define rm
      rm -f "$(1)"
    endef
    define rmdir
      rm -rf "$(1)"
    endef
    endif

    #---------------------------------------------------------------------------------
    # This is from devkitpro's MSVC stuff for makings errors cleaner, requires sed
    #---------------------------------------------------------------------------------
    #ISVC=$(or $(VCBUILDHELPER_COMMAND),$(MSBUILDEXTENSIONSPATH32),$(MSBUILDEXTENSIONSPATH))
    #
    #ifneq (,$(ISVC))
    #   ERROR_FILTER   :=   2>&1 | sed -e 's/\(.[a-zA-Z]\+\):\([0-9]\+\):/\1(\2):/g'
    #endif

    #---------------------------------------------------------------------------------
    %.a:
    #---------------------------------------------------------------------------------
       $(call rm,$@)
       $(AR) -rc $@ $^

    #---------------------------------------------------------------------------------
    %.o: %.cpp
       $(CXX) -MMD -MP -MF $(DEPSDIR)/$*.d $(CXXFLAGS) -c $< -o $@ $(ERROR_FILTER)
       
    #---------------------------------------------------------------------------------
    %.o: %.c
       $(CC) -MMD -MP -MF $(DEPSDIR)/$*.d $(CFLAGS) -c $< -o $@ $(ERROR_FILTER)

    #---------------------------------------------------------------------------------
    %.o: %.m
       $(CC) -MMD -MP -MF $(DEPSDIR)/$*.d $(OBJCFLAGS) -c $< -o $@ $(ERROR_FILTER)

    #---------------------------------------------------------------------------------
    %.o: %.s
       $(CC) -MMD -MP -MF $(DEPSDIR)/$*.d -x assembler-with-cpp $(ASFLAGS) -c $< -o $@ $(ERROR_FILTER)

    #---------------------------------------------------------------------------------
    %.o: %.S
       $(CC) -MMD -MP -MF $(DEPSDIR)/$*.d -x assembler-with-cpp $(ASFLAGS) -c $< -o $@ $(ERROR_FILTER)
       
    #---------------------------------------------------------------------------------
    %.g3a: %.bin
       $(MKG3A) $(MKG3AFLAGS) $< $@
       
    %.bin:
       $(LD)  $^ $(LDFLAGS) $(LIBPATHS) $(LIBS) -o $@

    #---------------------------------------------------------------------------------
    # canned command sequence for binary data
    #---------------------------------------------------------------------------------
    define bin2o
       bin2s -a 32 $< | $(AS) -o $(@)
       echo "extern const u8" `(echo $(<F) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`"_end[];" > `(echo $(<F) | tr . _)`.h
       echo "extern const u8" `(echo $(<F) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`"[];" >> `(echo $(<F) | tr . _)`.h
       echo "extern const u32" `(echo $(<F) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`_size";" >> `(echo $(<F) | tr . _)`.h
    endef




I really hope that we can figure it out!

The problem is that you've only installed the sh3eb-elf-binutils.
If you have installed the gcc as well, it is not in the same directory (which it needs to be).

You're right that projects/example is only in the Windows release. examples/skeleton is the equivalent for the mainline version.
I definitely did install gcc. But since I may have forgotten something I just did the setup guide again. Now, it is definitely installed:

Code:

laslo@MyTreasure-LinuxMint:/usr/local/cross/bin$ ls
sh3eb-elf-addr2line   sh3eb-elf-gcc-ar      sh3eb-elf-nm
sh3eb-elf-ar          sh3eb-elf-gcc-nm      sh3eb-elf-objcopy
sh3eb-elf-as          sh3eb-elf-gcc-ranlib  sh3eb-elf-objdump
sh3eb-elf-c++         sh3eb-elf-gcov        sh3eb-elf-ranlib
sh3eb-elf-c++filt     sh3eb-elf-gcov-dump   sh3eb-elf-readelf
sh3eb-elf-cpp         sh3eb-elf-gcov-tool   sh3eb-elf-size
sh3eb-elf-elfedit     sh3eb-elf-gprof       sh3eb-elf-strings
sh3eb-elf-g++         sh3eb-elf-ld          sh3eb-elf-strip
sh3eb-elf-gcc         sh3eb-elf-ld.bfd
sh3eb-elf-gcc-11.2.0  sh3eb-elf-lto-dump

laslo@MyTreasure-LinuxMint:~/Development/Prizm/libfxcg/examples/skeleton$ whereis gcc
gcc: /usr/bin/gcc /usr/lib/gcc /usr/share/gcc /usr/share/man/man1/gcc.1.gz /usr/src/gcc/gcc /usr/src/build-gcc/gcc

Now, when I try to run make in examples/skeleton, there is a new error Neutral :

Code:

laslo@MyTreasure-LinuxMint:~/Development/Prizm/libfxcg/examples/skeleton$ make
/usr/local/cross/bin/sh3eb-elf-gcc  example.o -mb -m4a-nofpu -mhitachi -nostdlib -T/home/laslo/Development/Prizm/libfxcg/toolchain/prizm.x -Wl,-static -Wl,-gc-sections  -L/home/laslo/Development/Prizm/libfxcg/lib -lc -lfxcg -lgcc -o /home/laslo/Development/Prizm/libfxcg/examples/skeleton/skeleton.bin
/usr/local/cross/lib/gcc/sh3eb-elf/11.2.0/../../../../sh3eb-elf/bin/ld: cannot find -lc
/usr/local/cross/lib/gcc/sh3eb-elf/11.2.0/../../../../sh3eb-elf/bin/ld: cannot find -lfxcg
collect2: error: ld returned 1 exit status
make[1]: *** [/home/laslo/Development/Prizm/libfxcg/toolchain/prizm_rules:83: /home/laslo/Development/Prizm/libfxcg/examples/skeleton/skeleton.bin] Error 1
make: *** [Makefile:108: all] Error 2
You didn't build libfxcg. If you can't be bothered doing that, you can also download prebuilts from the libfxcg releases page on Github (there's a package with the libraries only and none of the SDK stuff).
Tari wrote:
You didn't build libfxcg. If you can't be bothered doing that, you can also download prebuilts from the libfxcg releases page on Github (there's a package with the libraries only and none of the SDK stuff).

If you would like to build it, it's not that complicated.
Just

Code:
make
in the libfxcg directory.
It works now. I copied the prebuild libfxcg binarys into the source code and replaced some files, then edited prizm_rules again and then ran make. I think it should be put into the article that libfxcg must be either build or combined with the prebuild indexes. Thanks so much for helping me!
Lasslos wrote:
It works now. I copied the prebuild libfxcg binarys into the source code and replaced some files, then edited prizm_rules again and then ran make. I think it should be put into the article that libfxcg must be either build or combined with the prebuild indexes. Thanks so much for helping me!

Your'e very welcome!
I'll put that in if it isn't already.

If you have any more questions, please ask!
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement