Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example fails on macOS #116

Closed
BernCPlusPlus opened this issue Nov 27, 2022 · 7 comments
Closed

Example fails on macOS #116

BernCPlusPlus opened this issue Nov 27, 2022 · 7 comments

Comments

@BernCPlusPlus
Copy link

On a MacMini (3 GHz Intel Core i5) with macOS 10.14.6 the example test suite application fails with the following errors right out of the box:

-------------------------------------------------------------------------
               __________                                 ____  ___
    _____  __ _\______   \_____ _______  ______ __________\   \/  /
   /     \|  |  \     ___/\__  \\_  __ \/  ___// __ \_  __ \     / 
  |  Y Y  \  |  /    |     / __ \|  | \/\___ \\  ___/|  | \/     \ 
  |__|_|  /____/|____|    (____  /__|  /____  >\___  >__| /___/\  \
        \/                     \/           \/     \/           \_/
  Version 4.0.11 (2021-11-23)
  Copyright (C) 2021 Ingo Berg, et al.

-------------------------------------------------------------------------

Build configuration:

- RELEASE build
- ASCII build
- compiled with GCC Version 4.2.1
- IEEE 754 (IEC 559) is available
- 64 bit
- Floating point type is "d" (15 Digits)

-------------------------------------------------------------------------

Running test suite:

testing parser value types...passed
testing implicit definition of undefined variables...passed
testing error codes...
  Expression: "(1+3i)/(8*9i)+"hallo""  Code:1  Expected:44
  Expression: "(1+3i)/(8*9i)-"hallo""  Code:1  Expected:44
  Expression: "(1+3i)/(8*9i)*"hallo""  Code:1  Expected:44
  Expression: "(1+3i)/(8*9i)/"hallo""  Code:1  Expected:44
  Expression: "3n[1]"  Code:1  Expected:40
  failed with 5 errors
testing sample equations...passed
testing if-else conditional...passed
testing string functions...passed
testing matrix calculations...passed
testing complex calculations...
  1i : Undefined token "1i" found at position 0.
  norm(3+4i) : Undefined token "4i" found at position 7.
  norm(4i+3) : Undefined token "4i" found at position 5.
  norm(3i+4) : Undefined token "3i" found at position 5.
  real(4.1i+3.1) : Undefined token "4" found at position 5.
  imag(3.1i+4.1) : Undefined token "3" found at position 5.
  imag(2.1i) : Undefined token "2" found at position 5.
  -(4i+5) : Undefined token "4i" found at position 2.
  a=1+2i : Undefined token "2i" found at position 4.
  -(1+2i) : Undefined token "2i" found at position 4.
  -(-1-2i) : Undefined token "2i" found at position 5.
  (2+4i)*(8-6i) : Undefined token "4i" found at position 3.
  (-1+5i)^2 : Undefined token "5i" found at position 4.
  c=(a=1+2i) : Undefined token "2i" found at position 7.
  failed with 14 errors
testing vector operations...passed
testing binary operators...passed
testing postfix operators...
  1n : Undefined token "1n" found at position 0.
  8n : Undefined token "8n" found at position 0.
  8n : Undefined token "8n" found at position 0.
  failed with 3 errors
testing infix operators...passed
testing multiarg functions...passed
testing script features...passed
testing value reader...passed
testing github issue reports...passed
Test failed with 22 errors (612 expressions)
-------------------------------------------------------------------------

Special parser functions:
  list_var()   - list parser variables and return the number of variables.
  list_fun()   - list parser functions and return  the number of functions
  list_const() - list all numeric parser constants
Command line commands:
  exprvar      - list all variables found in the last expression
  rpn          - Dump reverse polish notation of the current expression
  quit         - exits the parser
Constants:
  "e"   2.718281828459045235360287
  "pi"  3.141592653589793238462643
-------------------------------------------------------------------------
@beltoforion
Copy link
Owner

The compiler is too old. GCC 4.2.1 was released on July 18, 2007. I cant support legacy systems.

@BernCPlusPlus
Copy link
Author

I get the same issue on macOS 12.6.1, which is (almost) the latest Apple OS. I think that's because gcc on macOS is just an alias for the built-in LLVM compiler, and gcc -v gives me

Apple clang version 14.0.0 (clang-1400.0.29.102)
Target: arm64-apple-darwin21.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

So if you plan on supporting macOS you should definitely look into this.

@beltoforion
Copy link
Owner

beltoforion commented Dec 2, 2022

Core problem is that i cannot fix what i cannot reproduce. Clang works just fine for me with Visual Studio. This issue will remain until it trickles into Visual Studios clang compiler or someone else submits a fix.

@BernCPlusPlus
Copy link
Author

Well, really all you need to do on a Mac is execute brew install cmake (assuming you have Homebrew installed) and then do cmake CMakelists.txt followed by a make all. Then execute ./examples and you're right where I was. Same result on macOS 10.14.6 and 12.6.1.

@beltoforion
Copy link
Owner

I cannot do anything on this Issue unless it also appear on a System I have access too. This is an Open Source project so if someone sees this and wants to debug the issue I will gladly merge a fix. That is all I can reasonably offer.

@nalinigans
Copy link
Contributor

Not sure of a fix yet. But this - https://discourse.llvm.org/t/different-behavior-from-stringstream-operator-in-libc-vs-libstdc/57482 - seems to be the issue.

nalinigans added a commit to nalinigans/muparserx that referenced this issue Feb 28, 2023
nalinigans added a commit to nalinigans/muparserx that referenced this issue Feb 28, 2023
nalinigans added a commit to nalinigans/muparserx that referenced this issue Feb 28, 2023
nalinigans added a commit to nalinigans/muparserx that referenced this issue Mar 2, 2023
beltoforion added a commit that referenced this issue Mar 4, 2023
@beltoforion
Copy link
Owner

Closed; Issue is fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants