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

feat: add C implementation for number/float32/base/signbit #3399

Open
wants to merge 17 commits into
base: develop
Choose a base branch
from

Conversation

Neerajpathak07
Copy link
Contributor

Resolves #3397

Description

What is the purpose of this pull request?

This pull request:

  • add C implementations for number/float32/base/signbit

Related Issues

Does this pull request have any related issues?

This pull request:

Questions

Any questions for reviewers of this pull request?

No.

Other

Any other information relevant to this pull request? This may include screenshots, references, and/or implementation notes.

No.

Checklist

Please ensure the following tasks are completed before submitting this pull request.


@stdlib-js/reviewers

@Neerajpathak07
Copy link
Contributor Author

Neerajpathak07 commented Dec 10, 2024

@Planeshifter I just added all the essential files and building the logic but I am still facing issues with the gyp native addons.
Would really appreciate a little help.

@Planeshifter
Copy link
Member

Planeshifter commented Dec 11, 2024

@Neerajpathak07

Check out the workflow failures.

E.g., the lint step of package.json in https://github.com/stdlib-js/stdlib/actions/runs/12264198244/job/34217519484?pr=3399

ERROR: package.json in lib/node_modules/@stdlib/number/float32/base/signbit needs updates to directories and/or gypfile fields
diff --git a/lib/node_modules/@stdlib/number/float32/base/signbit/package.json b/lib/node_modules/@stdlib/number/float32/base/signbit/package.json
index 0b5a[8](https://github.com/stdlib-js/stdlib/actions/runs/12264198244/job/34217519484?pr=3399#step:10:9)f15d..1f40f6e35 100644
--- a/lib/node_modules/@stdlib/number/float32/base/signbit/package.json
+++ b/lib/node_modules/@stdlib/number/float32/base/signbit/package.json
@@ -14,11 +14,14 @@
     }
   ],
   "main": "./lib",
+  "gypfile": true,
   "directories": {
     "benchmark": "./benchmark",
     "doc": "./docs",
     "example": "./examples",
+    "include": "./include",
     "lib": "./lib",
+    "src": "./src",
     "test": "./test"
   },
   "types": "./docs/types",

tells us that several needed fields are not set and should be added.

@stdlib-bot stdlib-bot added bot: In Progress Pull request is currently awaiting automation. and removed bot: In Progress Pull request is currently awaiting automation. labels Dec 11, 2024
@stdlib-js stdlib-js deleted a comment from stdlib-bot Dec 11, 2024
@Neerajpathak07
Copy link
Contributor Author

@Planeshifter I have added the essential files in the dependency tree of package.json.
But I am having doubts on how to resolve this particular error:-

gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
make[1]: Entering directory '/home/runner/work/stdlib/stdlib/lib/node_modules/@stdlib/number/float32/base/signbit/build'
  CC(target) Release/obj.target/addon/src/addon.o
../src/addon.c: In function ‘addon’:
../src/addon.c:63:18: warning: implicit declaration of function ‘napi_get_value_float’; did you mean ‘napi_get_value_bool’? [-Wimplicit-function-declaration]
   63 |         status = napi_get_value_float( env, argv[ 0 ], &value );
      |                  ^~~~~~~~~~~~~~~~~~~~
      |                  napi_get_value_bool
  CC(target) Release/obj.target/addon/src/main.o
  CC(target) Release/obj.target/addon/../to-word/src/to_word.o
  SOLINK_MODULE(target) Release/obj.target/addon.node
  COPY Release/addon.node
  ACTION Copying addon... src/addon.node
  TOUCH Release/obj.target/copy_addon.stamp
make[1]: Leaving directory '/home/runner/work/stdlib/stdlib/lib/node_modules/@stdlib/number/float32/base/signbit/build'
gyp info ok 

@stdlib-bot
Copy link
Contributor

stdlib-bot commented Dec 12, 2024

Coverage Report

Package Statements Branches Functions Lines
number/float32/base/signbit $\color{green}174/174$
$\color{green}+100.00\%$
$\color{green}7/7$
$\color{green}+100.00\%$
$\color{green}2/2$
$\color{green}+100.00\%$
$\color{green}174/174$
$\color{green}+100.00\%$

The above coverage report was generated for the changes in this PR.

@Neerajpathak07
Copy link
Contributor Author

@Planeshifter All CI checks are passing pls review it. I am going to need this for implementing atan2f

@Planeshifter
Copy link
Member

@Neerajpathak07 Wil try taking a look and review tonight.

@Neerajpathak07 Neerajpathak07 marked this pull request as ready for review December 12, 2024 16:26
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Dec 12, 2024
Copy link
Member

@Planeshifter Planeshifter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your work on this!

Looks pretty good to me. manifest.json will need some updates. @kgryte, you mind taking final look please and then merge the PR after the comments have been addressed?

@Neerajpathak07
Copy link
Contributor Author

Neerajpathak07 commented Dec 13, 2024

@Planeshifter Thank you for the review.
Additionally I had noticed that other files of number/float32/base didn't include the configurations of benchmark and examples in the manifest file. Any specific reasons that we are implementing them here??

@Neerajpathak07
Copy link
Contributor Author

@kgryte any suggestions from your side??

@Neerajpathak07
Copy link
Contributor Author

@kgryte would really appreciate a review on this since a PR #3338 is on stand-by and awaiting this to be merged!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Review A pull request which needs code review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[RFC]: Add C implementation for number/float32/base/signbit
3 participants