Auburn / FastNoiseSIMD

C++ SIMD Noise Library
MIT License
607 stars 89 forks source link

Running in OSX giving `Illegal instruction: 4` #8

Closed thesteeltoenail closed 7 years ago

thesteeltoenail commented 7 years ago

Here's my code:

#include <iostream>
#include <cmath>
#include "FastNoiseSIMD.h"
FastNoiseSIMD* noise = FastNoiseSIMD::NewFastNoiseSIMD();

int main() {
}

And my compile script

rm noise
g++ cpp/main.cpp cpp/FastNoiseSIMD.cpp -msse2 cpp/FastNoiseSIMD_sse2.cpp -msse4.1 cpp/FastNoiseSIMD_sse41.cpp -march=core-avx2 cpp/FastNoiseSIMD_avx2.cpp -std=c++11 -o noise
chmod +x noise

I compile with no errors. When I run './noise' it says: Illegal instruction: 4

Auburn commented 7 years ago

You have to compile each instruction set file separately making sure to only set the correct -flag for its matching file. Currently everything it being compiled with avx2 and causing illegal instruction error.

On 17 Mar 2017 1:44 p.m., "thesteeltoenail" notifications@github.com wrote:

Here's my code:

include

include

include "FastNoiseSIMD.h"

FastNoiseSIMD* noise = FastNoiseSIMD::NewFastNoiseSIMD(); int main() { }

And my compile script

rm noise g++ cpp/main.cpp cpp/FastNoiseSIMD.cpp -msse2 cpp/FastNoiseSIMD_sse2.cpp -msse4.1 cpp/FastNoiseSIMD_sse41.cpp -march=core-avx2 cpp/FastNoiseSIMD_avx2.cpp -std=c++11 -o noise chmod +x noise

I compile with no errors. When I run './noise' it says: Illegal instruction: 4

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Auburns/FastNoiseSIMD/issues/8, or mute the thread https://github.com/notifications/unsubscribe-auth/ABSXrAI_OLSPJziPPMVqbi4sFNea6c3Bks5rmo5CgaJpZM4Mgmw3 .

thesteeltoenail commented 7 years ago

Then do I link them to the main file? Or do I create different files for different processors?

thesteeltoenail commented 7 years ago

I compiled it with

rm noise
g++ -march=core-avx2 cpp/FastNoiseSIMD_avx2.cpp cpp/FastNoiseSIMD.cpp -c -std=c++11
g++ -msse4.1 cpp/FastNoiseSIMD_sse41.cpp cpp/FastNoiseSIMD.cpp -c -std=c++11
g++ -msse2 cpp/FastNoiseSIMD_sse2.cpp cpp/FastNoiseSIMD.cpp -c -std=c++11
mv *.o cpp
g++ cpp/main.cpp cpp/FastNoiseSIMD.cpp cpp/FastNoiseSIMD.cpp cpp/FastNoiseSIMD_sse2.o cpp/FastNoiseSIMD_sse41.o cpp/FastNoiseSIMD_avx2.o -std=c++11 -o noise
chmod +x noise

and I get

duplicate symbol __ZN13FastNoiseSIMD12GetSIMDLevelEv in:
    /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-077b36.o
    /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-de39c1.o
duplicate symbol __ZN18FastNoiseVectorSet4FreeEv in:
    /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-077b36.o
    /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-de39c1.o
duplicate symbol __Z14GetFastestSIMDv in:
    /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-077b36.o
    /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-de39c1.o
duplicate symbol __Z6xgetbvj in:
    /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-077b36.o
    /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-de39c1.o
duplicate symbol __ZN13FastNoiseSIMD13FillVectorSetEP18FastNoiseVectorSetiii in:
    /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-077b36.o
    /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-de39c1.o
duplicate symbol __ZN13FastNoiseSIMD21FillSamplingVectorSetEP18FastNoiseVectorSetiiii in:
    /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-077b36.o
    /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-de39c1.o
duplicate symbol __ZN13FastNoiseSIMD18GetSampledNoiseSetEiiiiiii in:
    /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-077b36.o
    /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-de39c1.o
duplicate symbol __ZN13FastNoiseSIMD20GetSamplingVectorSetEiiii in:
    /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-077b36.o
    /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-de39c1.o
duplicate symbol __ZN13FastNoiseSIMD12GetVectorSetEiii in:
    /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-077b36.o
    /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-de39c1.o
duplicate symbol __Z5cpuidPii in:
    /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-077b36.o
    /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-de39c1.o
duplicate symbol __ZN13FastNoiseSIMD11GetEmptySetEi in:
    /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-077b36.o
    /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-de39c1.o
duplicate symbol __ZN18FastNoiseVectorSet7SetSizeEi in:
    /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-077b36.o
    /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-de39c1.o
duplicate symbol __ZN13FastNoiseSIMD11AlignedSizeEi in:
    /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-077b36.o
    /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-de39c1.o
duplicate symbol __ZN13FastNoiseSIMD16NewFastNoiseSIMDEi in:
    /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-077b36.o
    /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-de39c1.o
duplicate symbol __ZN13FastNoiseSIMD12FillNoiseSetEPfiiiiiif in:
    /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-077b36.o
    /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-de39c1.o
duplicate symbol __ZN13FastNoiseSIMD13GetSimplexSetEiiiiiif in:
    /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-077b36.o
    /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-de39c1.o
duplicate symbol __ZN13FastNoiseSIMD14GetCellularSetEiiiiiif in:
    /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-077b36.o
    /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-de39c1.o
duplicate symbol __ZN13FastNoiseSIMD12GetPerlinSetEiiiiiif in:
    /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-077b36.o
    /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-de39c1.o
duplicate symbol __ZN13FastNoiseSIMD20GetSimplexFractalSetEiiiiiif in:
    /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-077b36.o
    /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-de39c1.o
duplicate symbol __ZN13FastNoiseSIMD19GetPerlinFractalSetEiiiiiif in:
    /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-077b36.o
    /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-de39c1.o
duplicate symbol __ZN13FastNoiseSIMD18GetValueFractalSetEiiiiiif in:
    /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-077b36.o
    /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-de39c1.o
duplicate symbol __ZN13FastNoiseSIMD18GetCubicFractalSetEiiiiiif in:
    /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-077b36.o
    /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-de39c1.o
duplicate symbol __ZN13FastNoiseSIMD11GetValueSetEiiiiiif in:
    /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-077b36.o
    /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-de39c1.o
duplicate symbol __ZN13FastNoiseSIMD11GetNoiseSetEiiiiiif in:
    /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-077b36.o
    /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-de39c1.o
duplicate symbol __ZN13FastNoiseSIMD16GetWhiteNoiseSetEiiiiiif in:
    /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-077b36.o
    /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-de39c1.o
duplicate symbol __ZN13FastNoiseSIMD11GetCubicSetEiiiiiif in:
    /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-077b36.o
    /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-de39c1.o
duplicate symbol __ZN13FastNoiseSIMD24CalculateFractalBoundingEif in:
    /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-077b36.o
    /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-de39c1.o
duplicate symbol __ZN13FastNoiseSIMD12FillNoiseSetEPfP18FastNoiseVectorSetfff in:
    /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-077b36.o
    /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-de39c1.o
duplicate symbol __ZN13FastNoiseSIMD12FreeNoiseSetEPf in:
    /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-077b36.o
    /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-de39c1.o
duplicate symbol __ZN13FastNoiseSIMD18s_currentSIMDLevelE in:
    /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-077b36.o
    /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-de39c1.o
ld: 30 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
chmod: noise: No such file or directory
Auburn commented 7 years ago

It looks like you are compiling FastNoiseSIMD.cpp multiple times and it's causing duplicate symbols.

On 17 March 2017 at 14:15, thesteeltoenail notifications@github.com wrote:

I compiled it with

rm noise g++ -march=core-avx2 cpp/FastNoiseSIMD_avx2.cpp cpp/FastNoiseSIMD.cpp -c -std=c++11 g++ -msse4.1 cpp/FastNoiseSIMD_sse41.cpp cpp/FastNoiseSIMD.cpp -c -std=c++11 g++ -msse2 cpp/FastNoiseSIMD_sse2.cpp cpp/FastNoiseSIMD.cpp -c -std=c++11 mv *.o cpp g++ cpp/main.cpp cpp/FastNoiseSIMD.cpp cpp/FastNoiseSIMD.cpp cpp/FastNoiseSIMD_sse2.o cpp/FastNoiseSIMD_sse41.o cpp/FastNoiseSIMD_avx2.o -std=c++11 -o noise chmod +x noise

and I get

duplicate symbol ZN13FastNoiseSIMD12GetSIMDLevelEv in: /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-077b36.o /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-de39c1.o duplicate symbol ZN18FastNoiseVectorSet4FreeEv in: /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-077b36.o /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-de39c1.o duplicate symbol Z14GetFastestSIMDv in: /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-077b36.o /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-de39c1.o duplicate symbol Z6xgetbvj in: /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-077b36.o /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-de39c1.o duplicate symbol ZN13FastNoiseSIMD13FillVectorSetEP18FastNoiseVectorSetiii in: /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-077b36.o /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-de39c1.o duplicate symbol ZN13FastNoiseSIMD21FillSamplingVectorSetEP18FastNoiseVectorSetiiii in: /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-077b36.o /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-de39c1.o duplicate symbol ZN13FastNoiseSIMD18GetSampledNoiseSetEiiiiiii in: /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-077b36.o /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-de39c1.o duplicate symbol ZN13FastNoiseSIMD20GetSamplingVectorSetEiiii in: /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-077b36.o /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-de39c1.o duplicate symbol ZN13FastNoiseSIMD12GetVectorSetEiii in: /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-077b36.o /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-de39c1.o duplicate symbol Z5cpuidPii in: /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-077b36.o /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-de39c1.o duplicate symbol ZN13FastNoiseSIMD11GetEmptySetEi in: /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-077b36.o /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-de39c1.o duplicate symbol ZN18FastNoiseVectorSet7SetSizeEi in: /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-077b36.o /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-de39c1.o duplicate symbol ZN13FastNoiseSIMD11AlignedSizeEi in: /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-077b36.o /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-de39c1.o duplicate symbol ZN13FastNoiseSIMD16NewFastNoiseSIMDEi in: /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-077b36.o /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-de39c1.o duplicate symbol ZN13FastNoiseSIMD12FillNoiseSetEPfiiiiiif in: /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-077b36.o /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-de39c1.o duplicate symbol ZN13FastNoiseSIMD13GetSimplexSetEiiiiiif in: /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-077b36.o /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-de39c1.o duplicate symbol ZN13FastNoiseSIMD14GetCellularSetEiiiiiif in: /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-077b36.o /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-de39c1.o duplicate symbol ZN13FastNoiseSIMD12GetPerlinSetEiiiiiif in: /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-077b36.o /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-de39c1.o duplicate symbol ZN13FastNoiseSIMD20GetSimplexFractalSetEiiiiiif in: /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-077b36.o /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-de39c1.o duplicate symbol ZN13FastNoiseSIMD19GetPerlinFractalSetEiiiiiif in: /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-077b36.o /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-de39c1.o duplicate symbol ZN13FastNoiseSIMD18GetValueFractalSetEiiiiiif in: /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-077b36.o /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-de39c1.o duplicate symbol ZN13FastNoiseSIMD18GetCubicFractalSetEiiiiiif in: /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-077b36.o /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-de39c1.o duplicate symbol ZN13FastNoiseSIMD11GetValueSetEiiiiiif in: /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-077b36.o /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-de39c1.o duplicate symbol ZN13FastNoiseSIMD11GetNoiseSetEiiiiiif in: /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-077b36.o /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-de39c1.o duplicate symbol ZN13FastNoiseSIMD16GetWhiteNoiseSetEiiiiiif in: /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-077b36.o /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-de39c1.o duplicate symbol ZN13FastNoiseSIMD11GetCubicSetEiiiiiif in: /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-077b36.o /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-de39c1.o duplicate symbol ZN13FastNoiseSIMD24CalculateFractalBoundingEif in: /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-077b36.o /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-de39c1.o duplicate symbol ZN13FastNoiseSIMD12FillNoiseSetEPfP18FastNoiseVectorSetfff in: /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-077b36.o /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-de39c1.o duplicate symbol ZN13FastNoiseSIMD12FreeNoiseSetEPf in: /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-077b36.o /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-de39c1.o duplicate symbol ZN13FastNoiseSIMD18s_currentSIMDLevelE in: /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-077b36.o /var/folders/m6/ck9kfhps317gtyx8skplc5b40000gn/T/FastNoiseSIMD-de39c1.o ld: 30 duplicate symbols for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) chmod: noise: No such file or directory

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Auburns/FastNoiseSIMD/issues/8#issuecomment-287365231, or mute the thread https://github.com/notifications/unsubscribe-auth/ABSXrFP8CdeRpN4jU5vcFa0F3sF2aQaKks5rmpWJgaJpZM4Mgmw3 .

thesteeltoenail commented 7 years ago

HA! My bad xD! I actually wrote g++ cpp/main.cpp cpp/FastNoiseSIMD.cpp cpp/FastNoiseSIMD.cpp cpp/FastNoiseSIMD_sse2.o cpp/FastNoiseSIMD_sse41.o cpp/FastNoiseSIMD_avx2.o -std=c++11 -o noise

g++ cpp/main.cpp cpp/FastNoiseSIMD.cpp cpp/FastNoiseSIMD.cpp cpp/FastNoiseSIMD_sse2.o cpp/FastNoiseSIMD_sse41.o cpp/FastNoiseSIMD_avx2.o -std=c++11 -o noise

I'm sorry I bothered you!

Auburn commented 7 years ago

You also need to compile FastNoiseSIMD_internal.cpp

On 17 March 2017 at 15:23, thesteeltoenail notifications@github.com wrote:

HA! My bad xD! I actually wrote g++ cpp/main.cpp cpp/FastNoiseSIMD.cpp cpp/FastNoiseSIMD.cpp cpp/FastNoiseSIMD_sse2.o cpp/FastNoiseSIMD_sse41.o cpp/FastNoiseSIMD_avx2.o -std=c++11 -o noise

g++ cpp/main.cpp cpp/FastNoiseSIMD.cpp cpp/FastNoiseSIMD.cpp cpp/FastNoiseSIMD_sse2.o cpp/FastNoiseSIMD_sse41.o cpp/FastNoiseSIMD_avx2.o -std=c++11 -o noise

I'm sorry I bothered you!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Auburns/FastNoiseSIMD/issues/8#issuecomment-287384542, or mute the thread https://github.com/notifications/unsubscribe-auth/ABSXrKbbkAfYM1jldy13Z4jb1grcHkM5ks5rmqVpgaJpZM4Mgmw3 .

thesteeltoenail commented 7 years ago

That's weird. It works just fine.

thesteeltoenail commented 7 years ago

Also, how is the preview able to render so fast? My code takes about 100ms to render exactly the same thing. (10x slower)

Auburn commented 7 years ago

FastNoiseSIMD Preview only measures the time it takes to generate the noise, not the time taken to turn it into an image.

On 17 March 2017 at 19:21, thesteeltoenail notifications@github.com wrote:

Also, how is the preview able to render so fast? My code takes about 250ms to render exactly the same thing.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/Auburns/FastNoiseSIMD/issues/8#issuecomment-287448269, or mute the thread https://github.com/notifications/unsubscribe-auth/ABSXrMUpwmIU1g_NFpDJSv3pgqx1sbg6ks5rmt1MgaJpZM4Mgmw3 .

thesteeltoenail commented 7 years ago

That's what I'm doing.

Auburn commented 7 years ago

Can you show me your noise generating code

On 17 March 2017 at 21:28, thesteeltoenail notifications@github.com wrote:

That's what I'm doing.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/Auburns/FastNoiseSIMD/issues/8#issuecomment-287475719, or mute the thread https://github.com/notifications/unsubscribe-auth/ABSXrCOAr_kmZ7cTVQ05k0DX9TYs7nhmks5rmvrtgaJpZM4Mgmw3 .

thesteeltoenail commented 7 years ago
#include <iostream>
#include <cmath>
#include "FastNoiseSIMD.h"
FastNoiseSIMD* noise = FastNoiseSIMD::NewFastNoiseSIMD();

void setFractalSettings(unsigned int octaves = 4, float scale = 0.1,
                        FastNoiseSIMD::FractalType fractalType = FastNoiseSIMD::FBM,
                        float lacunarity = 2.0, float gain = 0.5) {
    noise->SetFrequency(scale);
    noise->SetFractalOctaves(octaves);
    noise->SetFractalLacunarity(lacunarity);
    noise->SetFractalGain(gain);
    noise->SetFractalType(fractalType);
    noise->SetFrequency(scale);
}

void simplex(float offsetX, float offsetY, int w, int h,
                unsigned int octaves = 4, float scale = 0.1,
                FastNoiseSIMD::FractalType fractalType = FastNoiseSIMD::FBM,
                float lacunarity = 2.0, float gain = 0.5) {

    setFractalSettings(octaves, scale, fractalType, lacunarity, gain);
    //std::cout <<  "calculating\n";
    float* noiseSet = noise->GetSimplexFractalSet(0, offsetX, offsetY, 1, w + offsetX, h + offsetY);
    //std::cout <<  "done calculating and equalizing\n";
    int index = 0;
    //Get the noise
    for (int x = 0; x < w; x++) {
        for (int y = 0; y < h; y++) {
            //printf("%f,", (noiseSet[index++] + 1) / 2);
        }
        //printf(" ");
    }
    //std::cout <<  "done\n";
    FastNoiseSIMD::FreeNoiseSet(noiseSet);
}
int main() {
    simplex(0, 0, 512, 512, 4, FastNoiseSIMD::Billow);
}

Running it takes 94 ms

Auburn commented 7 years ago

Are you comparing it to running FastNoiseSIMD preview on the same PC, and are you compiling with high optimisation?

On 17 March 2017 at 21:41, thesteeltoenail notifications@github.com wrote:

include

include

include "FastNoiseSIMD.h"

FastNoiseSIMD* noise = FastNoiseSIMD::NewFastNoiseSIMD(); void setFractalSettings(unsigned int octaves = 4, float scale = 0.1, FastNoiseSIMD::FractalType fractalType = FastNoiseSIMD::FBM, float lacunarity = 2.0, float gain = 0.5) { noise->SetFrequency(scale); noise->SetFractalOctaves(octaves); noise->SetFractalLacunarity(lacunarity); noise->SetFractalGain(gain); noise->SetFractalType(fractalType); noise->SetFrequency(scale); } void simplex(float offsetX, float offsetY, int w, int h, unsigned int octaves = 4, float scale = 0.1, FastNoiseSIMD::FractalType fractalType = FastNoiseSIMD::FBM, float lacunarity = 2.0, float gain = 0.5) {

setFractalSettings(octaves, scale, fractalType, lacunarity, gain);

//std::cout << "calculating\n"; float* noiseSet = noise->GetSimplexFractalSet(0, offsetX, offsetY, 1, w + offsetX, h + offsetY); //std::cout << "done calculating and equalizing\n"; int index = 0; //Get the noise for (int x = 0; x < w; x++) { for (int y = 0; y < h; y++) { //printf("%f,", (noiseSet[index++] + 1) / 2); } //printf(" "); } //std::cout << "done\n"; FastNoiseSIMD::FreeNoiseSet(noiseSet); }int main() { simplex(0, 0, 512, 512, 4, FastNoiseSIMD::Billow); }

Running it takes 94 ms

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/Auburns/FastNoiseSIMD/issues/8#issuecomment-287478566, or mute the thread https://github.com/notifications/unsubscribe-auth/ABSXrC2M5WyDlTLHapTGvBBDoRD573rgks5rmv4mgaJpZM4Mgmw3 .

thesteeltoenail commented 7 years ago

I'm not comparing it to the same pc or compiling with high optimisation. What's the flag for that? Thanks so much!

Auburn commented 7 years ago

It depends on your compiler

On 17 March 2017 at 23:54, thesteeltoenail notifications@github.com wrote:

I'm not comparing it to the same pc or compiling with high optimisation. What's the flag for that? Thanks so much!

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/Auburns/FastNoiseSIMD/issues/8#issuecomment-287498639, or mute the thread https://github.com/notifications/unsubscribe-auth/ABSXrNoE_sDOyfNigq96eh-qUPLJC1loks5rmx0xgaJpZM4Mgmw3 .

thesteeltoenail commented 7 years ago

For gcc?

Auburn commented 7 years ago

http://www.rapidtables.com/code/linux/gcc/gcc-o.htm

On 18 March 2017 at 01:28, thesteeltoenail notifications@github.com wrote:

For gcc?

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/Auburns/FastNoiseSIMD/issues/8#issuecomment-287506947, or mute the thread https://github.com/notifications/unsubscribe-auth/ABSXrN07DcaZPlNwOSGemakmR1LJGjMGks5rmzM0gaJpZM4Mgmw3 .